Mogrify your images … Quick and Easy Batch Photo Resize March 12, 2009
When you upload your images to be viewed on the web, its best to reduce the size of the image to fit into a normal browser window and more importantly so that web site is quick and responsive to viewers. If you are working with a lot of images at once, such as for photo album, doing a manual resize for every image can be a hassle. Therefore you need look for a tool that can do batch resizing of your images at once.
I used to use IrfaanView to do batch resize. Now that I’ve completely moved my personal stuff off of Windows, I need a tool that can do the same but on Ubuntu. … In comes Mogrify. Mogrify can do many things on multiple files concurrently. All I care about doing here is resizing my photos, though.
To install mogrify, you need to install imagemagick suite, which mogrify is part of:
sudo apt-get install imagemagick
To resize an image, do:
mogrify -resize 640×640 MyPhoto.jpg
Keep in mind that this command will whipe out the old file a replace it with the new modify image. So make sure you are working on duplicate copies of the images.
You can also the resize in terms of percentage:
mogrify -resize 50% MyPhoto.jpg
To do a batch resize on on all the images in the directory, do:
mogrify -resize 640×640 *.jpg
Once again, use with caution or on duplicates, as the original image is lost.