Question

I would like to use the Linux' mogrify tool to remove the lower 20 pixels of several images with all different dimensions.

Example: Image width is 800px, image heigth is 600px. I would like to crop the image that the new size is 800x580px where the 20px from the bottom are removed.

I am struggling with the Image Geometry object.

Is there a way to formulate an Image Geometry object without providing the absolute dimensions per image? An object which can be used on every image achieving the 20px crop mentioned above?

If not: Based on the example above, how does the Image Geometry object has to look like if I have to provide the current dimensions of an image?

Thanks a lot!

Was it helpful?

Solution 2

Using -chop with -gravity should do the work:

mogrify image.jpg  -gravity south -chop x20

Nothe that gravity must precede the geometry settings to work. See ImageMagick for details

OTHER TIPS

Just found the answer based on chorobas approach:

mogrify -chop 0x20+0+0 -gravity South image.jpg

This site helped.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top