Page 1 of 1

Wrong colors after conversion PNG > JPG, why?

Posted: 2017-05-10T04:25:09-07:00
by McSodbrenner
Hi,

I've converted this PNG to a JPG with the command:

Code: Select all

>magick in.png -quality 100 out.jpg
(Version: Windows, ImageMagick 7.0.5-4 Q16 x64 2017-03-25)

Here are both images:
http://test.cerdmann.com/imagemagick/in.png
http://test.cerdmann.com/imagemagick/out.jpg

If you open them in Chrome or Firefox you will see that the JPG is a little bit brighter (or more saturated). And I don't understand why.

Both are in color space sRGB and there is no color profile involved:

Code: Select all

>magick identify in.png
in.png PNG 512x512 512x512+0+0 8-bit sRGB 475KB 0.000u 0:00.000

>magick identify out.jpg
out.jpg JPEG 512x512 512x512+0+0 8-bit sRGB 404KB 0.000u 0:00.000
Aside from that: If I open them in Photoshop or the Windows 10 image viewer both images are displayed identically.
In the browsers they aren't.

What am I missing here?

Thanks,
Christoph

Re: Wrong colors after conversion PNG > JPG, why?

Posted: 2017-05-10T08:55:24-07:00
by fmw42
Generally, different viewers may interpret sRGB without a profile differently. So I suggest you always add an sRGB profile to your images if you want them to look the same in different browsers.

Re: Wrong colors after conversion PNG > JPG, why?

Posted: 2017-05-10T10:51:29-07:00
by snibgo
In my Firefox 53.0.2 on Windows 8.1, I can see no difference between the images.

If your Firefox is old, an upgrade may help.

Perhaps one of the gfx.color_management settings in about.config is bad.

Are you using a PC with sRGB monitor, or something else?

Re: Wrong colors after conversion PNG > JPG, why?

Posted: 2017-05-12T00:01:40-07:00
by McSodbrenner
Firefox 53.0.2 (64-Bit) on Windows 10 with differences.
But I guess it has something to do with the color profile of my monitor (Dell U2412M). Read about a lot of misconceptions regarding browsers and color profiles.
But I still don't understand why both images are not treated the same...

Re: Wrong colors after conversion PNG > JPG, why?

Posted: 2017-05-12T01:58:31-07:00
by snibgo
McSodbrenner wrote:But I still don't understand why both images are not treated the same...
Nor do I. That would be a question for the Firefox people.

You might try a round-trip. You have created a jpg from a png, and Firefox shows them as different. Now create a second png from that jpg. Does it look like the first png, or the jpg?

Re: Wrong colors after conversion PNG > JPG, why?

Posted: 2017-05-23T02:29:07-07:00
by McSodbrenner
Sorry, for the late answer. I've taken a vacation.

I've created the PNG from the JPG and it looks like the source image. What emerges from this?

The PNG have a slightly different gamma value:
in.png: 0.45455
out.jpg: 0.454545
rebuild.png: 0.45455
Does that matter that much?