{"id":17962662,"url":"https://github.com/eneko/crop","last_synced_at":"2026-04-28T20:06:06.465Z","repository":{"id":136800816,"uuid":"121907169","full_name":"eneko/crop","owner":"eneko","description":"Command line tool to scale and crop images maintaining aspect ratio","archived":false,"fork":false,"pushed_at":"2021-01-17T17:17:49.000Z","size":160,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-09T07:25:26.719Z","etag":null,"topics":["cli","command-line-tool","console","crop","image","scale","swift-cli","swift-package-manager","terminal","tool"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eneko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-18T01:12:58.000Z","updated_at":"2021-05-22T17:43:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"74fe8f01-a1bb-43b4-987c-a7da7360b0b8","html_url":"https://github.com/eneko/crop","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eneko%2Fcrop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eneko%2Fcrop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eneko%2Fcrop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eneko%2Fcrop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eneko","download_url":"https://codeload.github.com/eneko/crop/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247061883,"owners_count":20877177,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cli","command-line-tool","console","crop","image","scale","swift-cli","swift-package-manager","terminal","tool"],"created_at":"2024-10-29T11:20:04.728Z","updated_at":"2026-04-28T20:06:06.424Z","avatar_url":"https://github.com/eneko.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"![crop](Media/crop_header.jpg)\n\n# crop\nA command line tool to **scale and crop images maintaining aspect ratio**.\n\nFrom local file:\n```\n$ crop original.png 1920 1080\n🏙 Original image size: 4284x2844\n🏙 Resized image size: 1920x1080\n📁 Resized image saved to: original_1920x1080.png\n```\n\nFrom web:\n```\n$ crop http://www.example.com/original.png 1920 1080\n```\n\nCustom filename:\n```\n$ crop http://www.example.com/original.png 1920 1080 -o output.png\n```\n\n\n## Usage\n\n```\nOVERVIEW: Resize and Crop images\n\nUSAGE: crop \u003cfilename|url\u003e \u003cwidth\u003e \u003cheight\u003e\n\nOPTIONS:\n  --output, -o\n             Output filename\n  --help     Display available options\n\nPOSITIONAL ARGUMENTS:\n  filename   Filename or URL\n  height     Output height in pixels\n  width      Output width in pixels\n```\n\n\n## Installation\n\nDownload the latest release and save in a folder in your executable path,\nfor example on `/usr/local/bin`:\n\n```\n$ curl -O https://github.com/eneko/crop/releases/download/0.0.1/crop.zip\n$ unzip crop.zip\n$ install -d /usr/local/bin\n$ install -C -m 755 crop /usr/local/bin/crop\n```\n\n\n## Scripting\n\nCommand line tools are great for scripting. Need to scale and crop an image to\nmultiple sizes? Say no more!\n\n```\n$ vim generate-appletv-images.sh\n```\n\n```sh\n#!/usr/bin/env sh\n\nORIGINAL=$1\n\ncrop $ORIGINAL 2320  720 -o TopShelf_Wide.jpg\ncrop $ORIGINAL 4640 1440 -o TopShelf_Wide@2x.jpg\ncrop $ORIGINAL 1920  720 -o TopShelf.jpg\ncrop $ORIGINAL 3840 1440 -o TopShelf@2x.jpg\ncrop $ORIGINAL 1280  768 -o AppIcon_AppStore.jpg\ncrop $ORIGINAL 2560 1536 -o AppIcon_AppStore@2x.jpg\ncrop $ORIGINAL  400  240 -o AppIcon_Small.jpg\ncrop $ORIGINAL  800  480 -o AppIcon_Small@2x.jpg\ncrop $ORIGINAL 1920 1080 -o Launch_Image.jpg\ncrop $ORIGINAL 3840 2160 -o Launch_Image@2x.jpg\n```\n\nSave with `:wq` and update permissions:\n```\n$ chmod 755 generate-appletv-images.sh\n```\n\nNow, when running the script, it will automatically generate all images at once.\n\n```\n$ ./generate-appletv-images.sh original.jpg\n🏙 Original image size: 4284x2844\n🏙 Resized image size: 2320x720\n📁 Resized image saved to: TopShelf_Wide.jpg\n🏙 Original image size: 4284x2844\n🏙 Resized image size: 4640x1440\n📁 Resized image saved to: TopShelf_Wide@2x.jpg\n🏙 Original image size: 4284x2844\n🏙 Resized image size: 1920x720\n📁 Resized image saved to: TopShelf.jpg\n🏙 Original image size: 4284x2844\n🏙 Resized image size: 3840x1440\n📁 Resized image saved to: TopShelf@2x.jpg\n🏙 Original image size: 4284x2844\n🏙 Resized image size: 1280x768\n📁 Resized image saved to: AppIcon_AppStore.jpg\n🏙 Original image size: 4284x2844\n🏙 Resized image size: 2560x1536\n📁 Resized image saved to: AppIcon_AppStore@2x.jpg\n🏙 Original image size: 4284x2844\n🏙 Resized image size: 400x240\n📁 Resized image saved to: AppIcon_Small.jpg\n🏙 Original image size: 4284x2844\n🏙 Resized image size: 800x480\n📁 Resized image saved to: AppIcon_Small@2x.jpg\n🏙 Original image size: 4284x2844\n🏙 Resized image size: 1920x1080\n📁 Resized image saved to: Launch_Image.jpg\n🏙 Original image size: 4284x2844\n🏙 Resized image size: 3840x2160\n📁 Resized image saved to: Launch_Image@2x.jpg\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feneko%2Fcrop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feneko%2Fcrop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feneko%2Fcrop/lists"}