batch for transforming images

Glenn R Williams gloonie at earthlink.net
Sat Sep 13 15:43:06 UTC 2008


Donn,

I think there is a mistake in your recipe:

After the convert command, instead of just "F" you need F.jpg, since the files 
are named filename.jpg. So the command line becomes:

ls *.jpg | sed 's/.jpg//' | xargs -I F convert F.jpg -quality 80 F.png
                                                                          ----



HTH,

Glenn


On Saturday 13 September 2008 11:32:32 Donn wrote:
> 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

-- 
Glenn R Williams
-------------------------
The footprints of occupation are beautiful when they are in a museum
	-- Mahmoud Darwish





More information about the kubuntu-users mailing list