Cropping multiple images in batch mode
test
test
Table of Contents
1 Cropping multiple images in batch mode
1.1 instru
tools: paint(Microsoft) GIMP
and mogrify
(from the ImageMagick suite),
- GIMP – graphically select the area to be cropped
- mogrify – cropping.
mogrify | overwrites the existing image |
convert | saves the image as a new image without modifying the original image |
Crop image using target width,height and offset in pixel
convert -crop 240x160+100+50 input.jpg output.jpg
# Crop the image to target size 240×160 with crop starting point at x=100,y=50
# start point, left upper corner
mogrify -gravity North -chop 0x300 *.jpg mogrify -gravity South -chop 0x300 *.gif
mogrify -gravity West -chop 150x0 *.gif
1 pixel (X) = 0.0264583333 cm
pixel –>> cm https://www.blitzresults.com/en/pixel/
mogrify -gravity North -chop 0x300 gap0.25ur3.92.jpg
The asterisk
makes bash fill in all png files in the current directory, and mogrify will handle them all happily.
1.2 cache resources exhausted
mogrify-im6.q16: cache resources exhausted `gap0.25ur3.92.gif' @ error/cache.c/OpenPixelCache/3984.
/etc/ImageMagick-6/policy.xml
change memory