imagemagick – mogrify – batch resize images

Batch Resize Images Using Imagemagick

Resize to 640×480 (maximum width and height), keep the aspect ratio

mogrify -resize 640x480 *.jpg

Resize to fixed width of 640, keep the aspect ratio

mogrify -resize 640 *.jpg

Resize to fixed height of 480, keep the aspect ratio

mogrify -resize x480 *.jpg

Resize to exact 640×480, change aspect ratio if necessary

mogrify -resize 640x480! *.jpg

Resize to 50% of original size, keep the aspect ratio

mogrify -resize 50% *.jpg

Resize images that are less than 640 pixel wide to 640px wide (image wider will be ignored)

mogrify -resize 640"<" *.jpg

Resize images that are more than 480 pixel height to 480px height (image image shorter will be ignored)

mogrify -resize x480">" *.jpg

Resize images to no larger than 640×480 (images with width and height less than 640 or 480 will be ignored)

mogrify -resize 640x480">" *.jpg

Resize images to 100K pixels

mogrify -resize 100000 *.jpg


http://dptnt.com/2007/09/batch-resize-images-using-imagemagick/



This entry was posted in Code Snippets. Bookmark the permalink.

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s