Simple photo resize

Code:
for image in *.jpg
do 
      convert $image -resize 800x600 800x600-$image
done
Writes a new file.

Could also use:
Code:
mogrify -resize 1280x960 *.jpeg
Which will overwrite the original image.

Instead of using the resolution (eg. 1280x960), you can use 30% or 75%.
"convert" and "mogrify" is part of the imagemagick program.
 
Last edited:
Thanks guys.

Gimp is cumbersome and takes a while.

I'm no Cli genius, but I think I need to try that.( I lie, I'm terrified of the command line)

One more question, I vaguely recall there being a way to do batches of images by Cli. Does my memory fail?
 
You can install gThumb image viewer, it does basics such as resize, crop etc... and can be used as default image viewer (duh).
 
Here's a quick rundown.

cd to the directory where the photos are.

If you want to resize a batch of photos that are all odd sizes, but you want them all to have the same width:
mogrify -resize 640 *.jpg

This will resize all the photos in that dir to width 640.

If you want to force a resize and not keep the aspect ratio:
mogrify -resize 640×480! *.jpg

This will ignore aspect ration and resize all photos in that dir to 640x480.

Replace *.jpg with whatever extension your photos have, remembering that Linux is case sensitive. Most digital cameras safes the files as *.JPG or *.JPEG
 
Top
Sign up to the MyBroadband newsletter
X