batch for transforming images

Donn donn.ingle at gmail.com
Sat Sep 13 15:32:32 UTC 2008


I just discovered something today.
1. It uses imagemagick.
2. I dunno about the dpi, but check the man pages for that.
3. Here's the recipe:
ls *.jpg | sed 's/.jpg//' | xargs -I F convert F -quality 80 F.png
That:
a. picked all jpg files.
b. stripped the .jpg off (using sed)
c. used 'xargs' to handle things like too many files at once and spaces in 
names. It also puts the filename into 'F'
(The arg to xargs is a dash capital "i", BTW, not a lower L)
d. calls convert on file 'F' setting quality to 80 and converting to F.png

You can adjust as you need to.

HTH
\d




More information about the kubuntu-users mailing list