Page 1 of 1

Yuv to Png conversion => Image "washed-out"

Posted: 2016-12-22T07:38:09-07:00
by tbertschi
Hello,

I have a YUV image captured with GStreamer that I convert to PNG using IM convert. Command line is the following:

convert -size 640x360 -sampling-factor 4:2:0 -depth 8 image.yuv -colorspace RGB image.png

On our previous platform (CentOS6 i686, IM 6.5.4-7), the converted PNG looked OK in a browser (Chrome, IE11). It looked identical when using an image viewer, such as "eog" (Eye of Gnome).

We have recently migrated to CentOS7 x86_64, IM 6.7.8-9. Using the same command line on the same YUV image, the resulting PNG looks OK with eog (as with CentOS6 version), but on Chrome & IE11, it looks all pale or washed-out.

I heard that default colorspace handling has changed between the two IM releases, and I have tried various colorspace / set colorspace combinations, but none of these achieved the same (good) result on the browsers as with the old version.

Does anyone know what the problem is and how to fix the command line to have a PNG that renders correctly on the browsers?

Thanks in advance & best regards,

Thierry

Re: Yuv to Png conversion => Image "washed-out"

Posted: 2016-12-22T08:24:54-07:00
by snibgo
The meaning of "-colorspace RGB" and "-colorspace sRGB" swapped between versions, so you now need "sRGB".

Re: Yuv to Png conversion => Image "washed-out"

Posted: 2016-12-23T01:49:26-07:00
by tbertschi
Hi,

Thanks for the reply, but using -colorspace sRGB instead of RGB in my command line does not produce any visible difference on the browsers. In eog, the sRGB one is now rendered as in the browsers, while the RGB one is rendered darker, as it originally was on older CentOS6 version.

In the meantime, I found that adding "-gamma 0.67" after the colorspace option in the conversion command gives the expected rendering on the browsers (visually identical to CentOS6 version without gamma correction). I don't really understand why, and it means I need a different conversion command between both platforms, but I can live with it...

Anyway, if you have some logical explanation for that behaviour, it will be welcome.

Re: Yuv to Png conversion => Image "washed-out"

Posted: 2016-12-23T11:05:47-07:00
by fmw42
IM 6.7.8-9 was during major changes to IM regarding colorspace and grayscale (and there could be bugs as well). I strongly urge you to upgrade past 6.8.5.x. Best to upgrade to the current version. See viewtopic.php?f=4&t=21269

Re: Yuv to Png conversion => Image "washed-out"

Posted: 2016-12-23T11:16:43-07:00
by snibgo
We have recently migrated to CentOS7 x86_64, IM 6.7.8-9 ...
Sorry, I misread that. I thought you had upgraded from that version.

I agree with Fred. Don't use that version. I suggest you upgrade to a current version, either v6 or v7.