Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AppleScript: Cutting images in the half?

Is it possible to cut an image in the half using AppleScript and save them seperately?

like image 638
trnc Avatar asked Jan 18 '23 13:01

trnc


1 Answers

It would be easier to use ImageMagick. This saves the left half as input-0.png and the right half as input-1.png:

convert input.png -crop 50%x100% +repage input.png

This saves just the right half as right.png:

convert input.png -gravity east -crop 50%x100% +repage right.png

+repage removes metadata for the old canvas size. See http://www.imagemagick.org/Usage/crop/.

You can install ImageMagick with brew install imagemagick or sudo port install imagemagick.

like image 146
Lri Avatar answered Feb 23 '23 14:02

Lri