5

I want to convert a png-image to a jpg image in imagemagick.

Usually I would use this command:

convert image.png image.jpg

This works since imagemagick determins the output format by looking at the file extension '.jpg'. Is there any commandline option for imagemagick to override this behaviour?

I would like to use something like this

convert image.png -outputformat jpg image.data

It is important for my application, that no *.jpg file is ever created in the process, so I can't "mv" it afterwards either!

11

I just found the solution:

convert image.png jpg:image.data

The jpg: is not written!

0

You are looking for the -format option: http://www.imagemagick.org/script/command-line-options.php#format

2
  • @dlemstra From that link, "When used with the mogrify utility". Does that mean I can't use the format option with convert for example? – Shawn Sep 15 '15 at 14:21
  • @Shawn No it doesn't. -format works with convert – Shawn Sep 15 '15 at 15:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.