batch image resizing?

xSauronx

Lifer
Jul 14, 2000
19,582
4
81
ive got a number of digital pics i want to downsize without having to do them one at a time, is there any tool i can use that will do this? someone at the ubuntu forums recommended digikam, but i dont have any kde stuff installed (using xubuntu 6.10) and wanted to keep it that way if i could

ive looked a bit but havent found anything else so far, any ideas?
 

xSauronx

Lifer
Jul 14, 2000
19,582
4
81
Originally posted by: Schadenfroh
irfanview (wait.... not sure if there is a linux port)

guess i can try it under wine and see how it works, maybe ill do that tomorrow, thanks
 

aidanjm

Lifer
Aug 9, 2004
12,411
2
0
Originally posted by: nweaver
imagemagick is the solution....the command would be convert.

the imagemagick suite of tools can do it, altho you have to be prepared to use the command line. to resize a file image.jpg to 300 by 300 pixels:

convert -sample 300x300! ./image.jpg ./output.jpg

convert also lets you change between formats, e.g., to change the .jpg to a .png file and also resize:

convert -sample 300x300! ./image.jpg ./output.png

you can combine the convert command with "find" to batch convert lots of files at once

find . -name "image.jpg" -execdir convert -sample 300x300! ./image.jpg ./output.jpg \;

this will convert all files called image.jpg in the current directory and any subdirectories to 300 by 300 pixels.


edit: supposedly this can also do it:

mogrify -resize 600x500! *

link: http://www.novell.com/coolsolutions/tip/16524.html

resizes all files in the current directory to 600 by 500. but overwrites the original, so make copies of the images

edit: leave out the ! after the pixel dimensions for proportional resizes
 

xSauronx

Lifer
Jul 14, 2000
19,582
4
81
thats exactly what i need, ill play with it sometime today or after work or something, thanks :)