Linux Hack – How to Batch Image Resize!

by max on Saturday, March 14th, 2009

Well, one of the worst things you can encounter is to individually resize hundreds of images for a future blog post.

I am not sure if Windows or Macs have free software to do this but if you have access to a Linux computer like me, you can get stuff done much faster using Image Magick, a free open-source image auto-resizer also used on many web-platform programs.

I assuming that you have installed Ubuntu Gutsy:

sudo apt-get install imagemagick

After ImageMagick installation, you can use mogrify. For example, I have a folder called “holidays” locate in “/home/user/photos/“. I have to change my path, make a thumbs folder and copy original images on “thumbs folder”. After that I can start image resizing process:

cd /home/user/photos/holidays
mkdir thumbs
cp /home/user/photos/holidays/* /home/user/photos/holidays/thumbs/
cd thumbs

mogrify -resize 640 *.jpg

Now I can see on “/home/user/photos/holidays/thumbs/” every my image file resized to 640 of width. If you want force resizing to a particulare size without mantaining original aspect ratio you could change mogrify options:

mogrify -resize 640×480! *.jpg

Good Job Man! I hope this howto will be useful for you.

via smokinglinux

Rate

1 Star2 Stars3 Stars4 Stars5 Stars
Loading ... Loading ...

ad ad
ad ad


20,000 GPS POI's $9.99

Related News and Resources

Other Interesting News From Our Friends

blog comments powered by Disqus
If you like this post then please subscribe to my full feed RSS.

You can also subscribe by E-mail by filling out your name and E-mail below:

Name: Email:


Got a new hack, DIY, howto, or gadget? Tip us here.

Try Goohack to find a new Hack:


Featured Sites From Zedomax Blog Network