[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to convert 100 bmp files to jpeg?



On Mon, Jan 30, 2006 at 10:56:03AM -0500, Stephen R Laniel wrote:
On Sun, Jan 15, 2006 at 04:05:42PM +1100, Star King of the Grape Trees wrote:
I can't be bothered to consult the man page, but it will be something like:

for $f in `ls *.bmp`; do convert $f --to-jpeg; done

Because I like to add little bits of efficiency where
necessary, I'll note that the `ls *.bmp` above is more
complicated than what you need. What you mean is
"for f in *.bmp".

Also, ImageMagick is nice, in that it does a lot of
conversions automatically just by extension. So

convert -resize 200x200 filename.{bmp,jpg}

, which combines a bashism with ImageMagick, will expand at
the shell into

convert -resize 200x200 filename.bmp filename.jpg

and ImageMagick will then automatically convert the file
from BMP to JPEG.

Just as a note, that syntax is obsolete and may break in the future. It's related to a bunch of changes in imagemagick 6 that were intended to make it more consistent. Command line options are now processed left to right as a series of steps (though grouping is supported).

See http://www.cit.gu.edu.au/~anthony/graphics/imagick6/basics/#why for more information.

--
Steve Block
http://ev-15.com/
http://steveblock.com/
scblock@ev-15.com



Reply to: