Converting tif->png works, tif->jpg does not

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
Shion
Posts: 13
Joined: 2013-11-26T04:18:21-07:00
Authentication code: 6789

Converting tif->png works, tif->jpg does not

Post by Shion »

Hi there

I've found a strange behaviour and am unsure whether my usage of ImageMagick is incorrect or it's a bug.
My Version is: ImageMagick 6.9.2-8 Q16 x64 2015-12-05 on Windows 64bit.

I have this original tif (display of the thumbnail is sadly not correct. The file should look like (for example in IrfanView) like the correct JPG below):
Image
The original file can be downloaded here: Download

If I use the following command the output is correct:

Code: Select all

convert original.tif correct.jpg
Image

On the other hand, when outputting a PNG file with the following command, the output is incorrect:

Code: Select all

convert original.tif incorrect.png
Image

Is this a bug in ImageMagick or are there any special commands that I need to when converting to PNG-files?

Thanks so much in advance!
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Converting tif->png works, tif->jpg does not

Post by magick »

The source image is CMYK. PNG does not support CMYK. Try converting to sRGB: convert original.tif -colorspace sRGB original.png. JPEG does not support the alpha channel.
Shion
Posts: 13
Joined: 2013-11-26T04:18:21-07:00
Authentication code: 6789

Re: Converting tif->png works, tif->jpg does not

Post by Shion »

Thank you for your reply.

Even with the command as follows I'm not able to produce the correct output:

Code: Select all

convert original.tif -colorspace sRGB output.png
I am aware of the alpha channel for JPGs. The problem is, even when opening the TIF in IrfanView or Photoshop the output is the same as the JPG. So the JPG output is definately correct.

Is there anything else that I can try to get the same output for PNG as well?

Thanks a lot
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Converting tif->png works, tif->jpg does not

Post by magick »

Add +matte to your command-line. That turns off the alpha channel.
Shion
Posts: 13
Joined: 2013-11-26T04:18:21-07:00
Authentication code: 6789

Re: Converting tif->png works, tif->jpg does not

Post by Shion »

Now I get what you meant with the alpha-channel.

Thank you for the +matte tip. This seems to solve my problem.
Post Reply