Cropping Multiple Images in Preview

I have 100 JPEGs open in one Preview window. All are the same size in pixels. All are selected in the Sidebar. While Image Size and Export and other commands work on all these images as a batch, the Crop command only works on the frontmost image.


Is there a way to extend Preview's batch processing capabilities to cropping, perhaps using AppleScript?


I've also tried in Photos.app with no luck.

Posted on May 29, 2023 05:33 PM

Reply
Question marked as Top-ranking reply

Posted on Sep 4, 2023 12:54 AM

try the `sips` command.


this cannot be undone so i suggest working on a copy of your files if not using a vcs or updating timemachine.


you can batch process with a loop in terminal.

cd your/image/dir
for f in *.«filetype»; do sips -c «h» «w» --cropOffset «Y» «H» "$f"; done

where:


`«filetype»` is the file extension eg `png`, `jpeg`


`-c` is the short opt for `--cropToHeightWidth` and `«h»` is pixels height, `«w»` is pixels width


`«Y»` is pixels from top, `«H»` is pixels on the horizontal axis


note:

if you specify 0 for the crop offset then the crop will be centered


an example I had images 3200x1800px


crop to left: 389, top: 32, Width: 2146, Height: 1723


sips -c 1723 2146 --cropOffset 32 389

Similar questions

2 replies
Question marked as Top-ranking reply

Sep 4, 2023 12:54 AM in response to jmrowland

try the `sips` command.


this cannot be undone so i suggest working on a copy of your files if not using a vcs or updating timemachine.


you can batch process with a loop in terminal.

cd your/image/dir
for f in *.«filetype»; do sips -c «h» «w» --cropOffset «Y» «H» "$f"; done

where:


`«filetype»` is the file extension eg `png`, `jpeg`


`-c` is the short opt for `--cropToHeightWidth` and `«h»` is pixels height, `«w»` is pixels width


`«Y»` is pixels from top, `«H»` is pixels on the horizontal axis


note:

if you specify 0 for the crop offset then the crop will be centered


an example I had images 3200x1800px


crop to left: 389, top: 32, Width: 2146, Height: 1723


sips -c 1723 2146 --cropOffset 32 389

May 30, 2023 05:01 AM in response to jmrowland

Preview is not the drug of choice for batch conversion, and its AppleScript support is essentially useless. One alternative that offers powerful image batch conversion is Graphic Converter.


There is a free demo and it is reasonably priced for its extensive image processing power. I own GC 12 and do not receive any benefits from its vendor for mentioning the product here. It is available for purchase in the Mac App Store or directly from the vendor site.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Cropping Multiple Images in Preview

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.