Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to convert image formats.

I can use 'convert' command, but it made another image.

So I searched and find 'mogrify' command in ImageMagick official page.

What I did was

mogrify -format png a.jpg

What I expected was one image that has 'png' extension.

But it did not overwrite original image, but made another png image in my folder.

How Can I get only one image(that means overwite original file) in some format

that I want?


share|improve this question
Are you trying to create a .jpg file with PNG data in it? – Darth Android Jun 26 '13 at 1:59
@DarthAndroid no. I want to change format bmp to png. upper one is just sample – Juneyoung Oh Jun 26 '13 at 2:13
regarding the site, they say if i use that -format function, overwrite will not happen. So How Can I make this force overwrite? <-- this is what I actually curios of. – Juneyoung Oh Jun 26 '13 at 2:23
up vote 2 down vote accepted

ImageMagick's mogrify isn't the best tool here, turns out convert is much better suited for the job. It can be done by specifying output format with the file name.

convert a.jpg png:a.jpg


$ file a.jpg 
a.jpg: JPEG image data, JFIF standard 1.01
$ convert a.jpg png:a.jpg
$ file a.jpg 
a.jpg: PNG image data, 300 x 199, 8-bit/color RGB, non-interlaced
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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