{"id":40663613,"url":"https://github.com/backplane/cutout","last_synced_at":"2026-01-21T09:05:04.190Z","repository":{"id":325763747,"uuid":"1102301187","full_name":"backplane/cutout","owner":"backplane","description":"command-line tool for extracting rectangular regions from images","archived":false,"fork":false,"pushed_at":"2025-11-23T07:51:12.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-23T09:17:32.501Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/backplane.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-23T07:40:01.000Z","updated_at":"2025-11-23T07:50:52.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/backplane/cutout","commit_stats":null,"previous_names":["backplane/cutout"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/backplane/cutout","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backplane%2Fcutout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backplane%2Fcutout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backplane%2Fcutout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backplane%2Fcutout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/backplane","download_url":"https://codeload.github.com/backplane/cutout/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backplane%2Fcutout/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28630939,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-21T09:05:03.568Z","updated_at":"2026-01-21T09:05:04.185Z","avatar_url":"https://github.com/backplane.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cutout\n\nA command-line tool for extracting rectangular regions from images.\n\n## Overview\n\n`cutout` allows you to define one or more rectangular regions and extract them from images. It supports multiple capture specifications per image and can work with different coordinate systems (top-left or bottom-left origin).\n\n## Usage\n\n```sh\ncutout [OPTIONS] --capture \u003cSPEC\u003e \u003cINPUTS\u003e...\n```\n\n### Arguments\n\n- `\u003cINPUTS\u003e...` - One or more input image files to process\n\n### Options\n\n- `-c, --capture \u003cSPEC\u003e` - Capture specification (can be repeated for multiple regions)\n\n  - Format: `\u003cname\u003e:\u003cx\u003ex\u003cy\u003e:\u003cwidth\u003ex\u003cheight\u003e`\n  - Example: `left:200x300:1200x1850`\n\n- `--origin \u003cORIGIN\u003e` - Coordinate system origin (default: `tl`)\n  - `tl`, `top-left`, or `top_left` - Standard image coordinates (0,0 at top-left)\n  - `bl`, `bottom-left`, or `bottom_left` - Y coordinates measured from bottom\n\n- `-v, --verbose` - Enable verbose output with timing information\n\n- `--dry-run` - Validate capture specifications without processing images\n\n### Output\n\nFor each input image and capture specification, the tool creates an output file named:\n\n```\n\u003cbasename\u003e_\u003ccapture_name\u003e.\u003cextension\u003e\n```\n\nFor example, processing `photo.jpg` with capture name `left` produces `photo_left.jpg`.\n\n## Examples\n\n### Extract a single region from an image\n\n```sh\ncutout --capture \"center:100x100:200x200\" image.jpg\n```\n\nThis extracts a 200×200 pixel region starting at coordinates (100, 100) and saves it as `image_center.jpg`.\n\n### Extract multiple regions from the same image\n\n```sh\ncutout \\\n  --capture \"left:0x0:500x1000\" \\\n  --capture \"right:500x0:500x1000\" \\\n  image.jpg\n```\n\nThis splits the image into left and right halves, creating `image_left.jpg` and `image_right.jpg`.\n\n### Process multiple images with the same capture specifications\n\n```sh\ncutout --capture \"header:0x0:1920x200\" *.png\n```\n\nThis extracts the top 200 pixels from all PNG files in the current directory.\n\n### Use bottom-left coordinate system\n\n```sh\ncutout --origin bl --capture \"bottom:0x0:800x100\" chart.png\n```\n\nThis extracts a 800×100 pixel region from the bottom of the image (useful for charts and plots where measurements are naturally from the bottom).\n\n### Complex example with multiple captures\n\n```sh\ncutout \\\n  --capture \"header:0x0:1920x100\" \\\n  --capture \"footer:0x980:1920x100\" \\\n  --capture \"content:200x100:1520x880\" \\\n  page.jpg\n```\n\nThis extracts header, footer, and main content regions from a page layout.\n\n### Validate capture specifications before processing\n\n```sh\ncutout --dry-run --capture \"left:0x0:500x1000\" image.jpg\n```\n\nThis validates that the capture specification is valid for the given image without actually processing it.\n\n### Enable verbose output with timing\n\n```sh\ncutout --verbose --capture \"region:100x100:200x200\" *.jpg\n```\n\nThis processes images with verbose output showing decode and crop/save timing for each file.\n\n## Coordinate Systems\n\n### Top-Left Origin (default)\n\nIn the standard coordinate system, (0, 0) is at the top-left corner of the image:\n\n- X increases going right\n- Y increases going down\n\n### Bottom-Left Origin\n\nWhen using `--origin bl`, (0, 0) is at the bottom-left corner:\n\n- X increases going right\n- Y increases going up\n\nThis is useful when working with charts, graphs, or other images where measurements are naturally from the bottom.\n\n## Error Handling\n\nThe tool validates all coordinates before processing and will report clear errors if:\n\n- Capture specifications are malformed\n- Coordinates are outside image bounds\n- Width or height is zero\n- Images cannot be opened or saved\n\n## Supported Image Formats\n\nSupports all formats provided by the `image` crate, including:\n\n- JPEG\n- PNG\n- GIF\n- BMP\n- TIFF\n- WebP\n- And more\n\nOutput format is inferred from the input file extension.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbackplane%2Fcutout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbackplane%2Fcutout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbackplane%2Fcutout/lists"}