Page 1 of 1

How to convert multiple files, keeping the same name

Posted: 2012-07-17T07:12:32-07:00
by rekam
Hi !

I searched bit and tried a little bit, but I can't find a solution to this: I have multiple PCT files that I want to transform to jpeg. To convert one, I do:

Code: Select all

convert -quality 100 1.pct 1.jpg
Easy and it works. But then I have tons of pct files. So

Code: Select all

convert -quality 100 *.pct jpg
.. does the trick, but then my jpg files aren't named correctly. I tried with some #, *, {0}, _, | and other signs but any of them just keep the name for each photo.

What do I need to do to just change the extension?

Thanks!

Re: How to convert multiple files, keeping the same name

Posted: 2012-07-17T10:12:02-07:00
by fmw42
see mogrify

http://www.imagemagick.org/Usage/basics/#mogrify

but I recommend you use the path option so as not to overwrite your original images.

Re: How to convert multiple files, keeping the same name

Posted: 2012-07-17T16:16:16-07:00
by anthony
If going to a different format use -format jpg with mogrify

Re: How to convert multiple files, keeping the same name

Posted: 2012-07-20T01:16:04-07:00
by rekam
anthony wrote:If going to a different format use -format jpg with mogrify
Thanks, that's it!

Here's the code I used:

Code: Select all

mogrify -format pct *.jpg