Home > Linux, Useful commands > Create thumbnail with fixed size and keep aspect ratio.

Create thumbnail with fixed size and keep aspect ratio.

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

Categories: Linux, Useful commands
  1. 22/07/2012 at 21:04

    Nareszcie dalej piszesz🙂

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: