Archive

Archive for July, 2012

Create thumbnail with fixed size and keep aspect ratio.

21/07/2012 1 comment

I would like to have fixed size for my thumbnails ex. 75×75 but the aspect ratio of it isn’t 1:1. To do this image must be centered, cropped and then resized. This could be done by bellow command:

mogrify -format jpg -resize "75x75^" -gravity center -crop 75x75+0+0 +repage 001.jpg

Sample image:

Thumbnail:

ps. mogrify is a part of ImageMagick

Advertisements
Categories: Linux, Useful commands