{"id":15877568,"url":"https://github.com/dumrauf/desktop_pictures_cropper","last_synced_at":"2026-05-09T01:02:16.106Z","repository":{"id":133006759,"uuid":"141937608","full_name":"dumrauf/desktop_pictures_cropper","owner":"dumrauf","description":"A Bash script to crop a set of images so that they can be used as native high resolution desktop pictures","archived":false,"fork":false,"pushed_at":"2018-08-21T23:30:43.000Z","size":1074,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-01T23:28:47.568Z","etag":null,"topics":["bash","crop-image","exiftool","imagemagick","macos"],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/dumrauf.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-22T23:11:37.000Z","updated_at":"2018-08-21T23:30:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"fed7e3d8-f87b-435a-ad09-38549620b753","html_url":"https://github.com/dumrauf/desktop_pictures_cropper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dumrauf/desktop_pictures_cropper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dumrauf%2Fdesktop_pictures_cropper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dumrauf%2Fdesktop_pictures_cropper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dumrauf%2Fdesktop_pictures_cropper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dumrauf%2Fdesktop_pictures_cropper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dumrauf","download_url":"https://codeload.github.com/dumrauf/desktop_pictures_cropper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dumrauf%2Fdesktop_pictures_cropper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32803625,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["bash","crop-image","exiftool","imagemagick","macos"],"created_at":"2024-10-06T02:01:59.443Z","updated_at":"2026-05-09T01:02:16.083Z","avatar_url":"https://github.com/dumrauf.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Desktop Pictures Cropper\n\nThis repository contains a Bash script to [crop](https://en.wikipedia.org/wiki/Cropping_(image)) a set of images so that they can be used as native desktop pictures.\nThe resulting images have the same high resolution as the stock [macOS](https://en.wikipedia.org/wiki/MacOS) desktop pictures.\n\n\n## You Have\n\nBefore you can use the tool in this repository out of the box, you need the following tools preinstalled\n - a recent version of [`exiftool`](https://www.sno.phy.queensu.ca/~phil/exiftool/) (the script has successfully been tested with version 10.59)\n - a recent version of [ImageMagick](https://www.imagemagick.org/script/index.php) that ships with the [`convert`](https://www.imagemagick.org/script/convert.php) programme (the script has successfully been tested with ImageMagick 6.9.9-26 Q16 x86_64 2018-03-07)\n\nMoreover, you need\n - a collection of landscape or portrait images\n - to decide how to crop each image\n\n\n## You Want\n\nAfter cropping the images, you get\n - `5120px x 2880px` high resolution _landscape_ desktop pictures\n - `2880px x 5120px` high resolution _portrait_ desktop pictures\n\nHere, the images are output to corresponding sub-directories named `Landscape` and `Portrait` and can be used as macOS desktop pictures as is. Note that the final image size can be configured if needed. See the FAQs for details.\n\n\n## Pre-Sorting the Images\n\nThe cropping script requires your input in deciding which section of the image to crop.\nThe section to crop is determined by the folder the image is located in. Here, folder names are chosen to _represent the area that is unaffected by the cropping_.\n\n\n### Landscape Images\n\nThere are three options available for _landscape_ images:\n\n 1. North\n 2. Center\n 3. South\n\nConsider the following example of a lovingly handcrafted example landscape image\n\n![Example Landscape Image](Originals/Center/centre_landscape.png)\n\nThe items in the image roughly represent \n - the sun in the upper right hand corner,\n - two mountains in the middle, and \n - a pond in the bottom left hand corner.\n\n#### North\n\nThis option preserves the top section of the image and clips a bottom section of the image. For the example landscape image, the resulting cropped image is\n\n![North Example Cropped Landscape Image](Cropped/Landscape/north.jpg)\n\nHere, note how the _pond at the bottom left hand corner has been cropped_.\n\n#### Center\n\nThis option preserves the centre section of the image and clips an equal section of the top and bottom of the image. For the example landscape image, the resulting cropped image is\n\n![Centre Example Cropped Landscape Image](Cropped/Landscape/centre_landscape.jpg)\n\nHere, note how the _sun in the upper right hand corner as well as the pond at the bottom left hand corner have been cropped_.\n\n#### South\n\nThis option preserves the bottom section of the image and clips a top section of the image. For the example landscape image, the resulting cropped image is\n\n![South Example Cropped Landscape Image](Cropped/Landscape/south.jpg)\n\nHere, note how the _sun in the upper right hand corner has been cropped_.\n\n\n### Portrait Images\n\nThere are three options available for _portrait_ images:\n\n 1. East\n 2. Center\n 3. West\n\nConsider the following example of a lovingly handcrafted example portrait image\n\n![Example Portrait Image](Originals/Center/centre_portrait.png)\n\nThe items in the image again roughly represent \n - the sun in the upper left hand corner,\n - two mountains in the middle, and \n - a pond in the bottom right hand corner.\n\n#### East\n\nThis option preserves the right hand section of the image and clips a section on the left hand side of the image. For the example portrait image, the resulting cropped image is\n\n![East Example Cropped Portrait Image](Cropped/Portrait/east.jpg)\n\nHere, note how the _sun in the upper left hand corner has been cropped_.\n\n#### Center\n\nThis option preserves the centre section of the image and clips an equal section of the left and right hand side of the image. For the example portrait image, the resulting cropped image is\n\n![Centre Example Cropped Portrait Image](Cropped/Portrait/centre_portrait.jpg)\n\nHere, note how the _sun in the upper left hand corner as well as the pond at the bottom right hand corner have been cropped_.\n\n\u003e In order to avoid duplication, the same `Center` folder is _used for both landscape and portrait images_.\n\n#### West\n\nThis option preserves the left hand section of the image and clips a section on the right hand side of the image. For the example portrait image, the resulting cropped image is\n\n![West Example Cropped Portrait Image](Cropped/Portrait/west.jpg)\n\nHere, note how the _pond in the bottom right hand corner has been cropped_.\n\n\n## Execution\n\nThe stand-alone Bash script `cropper.sh` is located in the root folder. It requires an `\u003cinput-directory\u003e` of pre-sorted background images (see above for details) as well as an `\u003coutput-directory\u003e` where to write the cropped images to. In case the `\u003coutput-directory\u003e` does not exist, it is created.\n\nNote that all landscape images are eventually located in `\u003coutput-directory\u003e/Landscape/`. All portrait images are eventually located in `\u003coutput-directory\u003e/Portrait/`.\n\nAll pre-sorted images in `Originals/` can be cropped and output to `Cropped/` via\n```\ncropper.sh \"Originals/\" \"Cropped/\"\n```\n\n\n## Output File Naming and Caching\n\nEach image `\u003cname\u003e.\u003csuffix\u003e` located in the input directory is eventually converted to `\u003cname\u003e.jpg` in the output directory. Here, `\u003csuffix\u003e` is a file extension `convert` can handle.\n\nAs converting and cropping images can be a time consuming task, the Bash script treats each file `\u003cname\u003e.jpg` in the output directory as the converted and cropped image of `\u003cname\u003e.\u003csuffix\u003e`. Hence, `\u003cname\u003e.\u003csuffix\u003e` is assumed to have already been converted and is subsequently ignored.\n\n\n## FAQs\n\n### What's the Resolution of the Resulting Landscape Desktop Pictures?\n\nThe cropped landscape desktop pictures are `5120px x 2880px`. Note that this is also the resolution of the stock macOS desktop pictures in `/Library/Desktop Pictures`\n\n\n### What's the Resolution of the Resulting Portrait Desktop Pictures?\n\nThe cropped portrait desktop pictures are `2880px x 5120px`.\n\n\n### How Can I Change the Resolution of Landscape Images?\n\nThe cropping values for landscape images are defined in variables\n - `LANDSCAPE_WIDTH`\n - `LANDSCAPE_HEIGHT`\n\nat the beginning of `cropper.sh`. Adjust them as needed.\n\n\n### How Can I Change the Resolution for Portrait Images?\n\nThe cropping values for portrait images are defined in variables\n - `PORTRAIT_WIDTH`\n - `PORTRAIT_HEIGHT`\n\nat the beginning of `cropper.sh`. Adjust them as needed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdumrauf%2Fdesktop_pictures_cropper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdumrauf%2Fdesktop_pictures_cropper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdumrauf%2Fdesktop_pictures_cropper/lists"}