• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

PNG support for colour profiles incomplete/unpredictable in CC 2018

Explorer ,
Oct 22, 2017 Oct 22, 2017

Copy link to clipboard

Copied

Hello,

The new Export As... Embed profile checkbox doesn’t work properly with PNG8 files (“Smaller Files”). Mac and Windows edition of CC 2018 behaves differently when it comes to recognising sRGB chunk in PNG files (incl. those saved from Photoshop). The new CC 2018 PNG support through Save As.. has lost an ability to embed colour profiles (it works correctly in CC 2017).

For a detailed report, please see: PNG8 colour support broken · Issue #392 · adobe-photoshop/generator-core · GitHub

Regards

m.

Views

3.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
New Here ,
Mar 13, 2022 Mar 13, 2022

Copy link to clipboard

Copied

My evidence is that Photoshop is not converting srgb to linear before doing the premultiply.  This means that this imaging tool does linear alpha * non-linear srgb colors that came directly out of the file, then it simply re-exports these as srgb.   Now when the sampler reads this it does a non-linear conversion from (srgb * a) -> linear.   So the alpha premultiply that results isn't linear anymore.  The result is that sampling these produces very muted colors.  

 

Untaggged png images are not in sRGB space.  The apps are ignoring this flag and assuming PNG for the reasons I documented about lack of consistency, and Photoshop leaving this important flag off.  It should also preserve, and re-export this setting with the images, since artists will forget to set it.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 13, 2022 Mar 13, 2022

Copy link to clipboard

Copied

I don't know what you are referring to.  This is the code for identifying isSrgb from gAMA using the lodepng API.  It doesn't have the linear ramp at low values, but a pow(1/2.2) curve meant to indicate sRGB since no one has indicated how to parse the iccp for this.

 

 if (!chunkData) {

        chunkData = lodepng_chunk_find_const(data, end, "gAMA");

        if (chunkData) {

            lodepng_inspect_chunk(&state, chunkData - data, data, end-data);

            if (state.info_png.gama_defined) {

                if (!isSrgb)

                    isSrgb = state.info_png.gama_gamma == 45455; // 1/2.2 x 100000

            }

                

        }

    }

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 13, 2022 Mar 13, 2022

Copy link to clipboard

Copied

That's news to me, since I worked at Apple and Adobe and EA.  The gpu samplers support sRGB (althought Xbox 360 had a piecewise linear sRGB curve).   The color-space conversion is all shader-based, and sometimes sampler based for some formats.  So yes, there's extended sRGB, and a few other formats that one can access, but the lowest-common denominator and publicly accessible formats are for BC1 and BC1_srgb.  Can do anything with RGBA16f, but it's all ALU code.  That's why games only use block ompressed textures like BC, ETC, ASTC, and get further color compression (10-11 bit colors) by resorting to endpoints on each of thse in sRGB (and premultiplied) space.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 13, 2022 Mar 13, 2022

Copy link to clipboard

Copied

The spec says to honor ICCP, and fallback to Gama, Chrm, and others.  Srgb is also exclusive of ICCP.   But I still don't know what to parse out of the iccp profile to identify sRGB.  Do i have to compare 9 float values of seperate r/g/b matrices.   Ugh.  The srgb icc color profiles from the icc website that I downloaded are each 64K, and so I assume Apple and Adobe are leaving out giant chunks to get these down to 3K.  And yes, I'm ignoring that these might be default compressed.  

 

I can fallback to the Gama block that Adobe includes, but that's my current code waterfall is to test in priority order.  I just don't know what to test.  Some online ICCP profiles stick "sRGB" as a fourCC on deviceModel, but Apple and I think Adobe leave this off. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 13, 2022 Mar 13, 2022

Copy link to clipboard

Copied

"pow(1/2.2) curve meant to indicate sRGB" sRGB IS NOT 2.2 GAMMA. Why so many people do such a mistake? the code you mentioned is just giving fallback values for gAMA chunk, 2.2 is mandated in png spec for sRGB chunk. Only when sRGB chunk is present you are using it, that is for old apps.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 13, 2022 Mar 13, 2022

Copy link to clipboard

Copied

"That's news to me, since I worked at Apple and Adobe and EA.  The gpu samplers support sRGB (althought Xbox 360 had a piecewise linear sRGB curve).   The color-space conversion is all shader-based, and sometimes sampler based for some formats.  So yes, there's extended sRGB, and a few other formats that one can access, but the lowest-common denominator and publicly accessible formats are for BC1 and BC1_srgb"

 

LOL, i did not mean using bare OpenCL/GL/Vulkan, but this as part of skia: https://skia-review.googlesource.com/c/skcms/+/388596/21

 

Last time I checked it is run on GPU. This is skcms, that works like Little CMS using all kind of GPGPU, shaders (HLSL) and other stuff. No insanely complex CMYK support yet.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 13, 2022 Mar 13, 2022

Copy link to clipboard

Copied

"The spec says to honor ICCP, and fallback to Gama, Chrm, and others.  Srgb is also exclusive of ICCP.   But I still don't know what to parse out of the iccp profile to identify sRGB.  Do i have to compare 9 float values of seperate r/g/b matrices.   Ugh.  The srgb icc color profiles from the icc website that I downloaded are each 64K, and so I assume Apple and Adobe are leaving out giant chunks to get these down to 3K.  And yes, I'm ignoring that these might be default compressed. "

The spec only says to fallback for old applications. All new applications must use sRGB with linear part for sRGB chunk and sRGB variant (that is never a pure sRGB, since how ICC spec is done) in iCCP chunk, not pure 2.2 gamma, *that* is what gAMA chunk is. I just recommend using Little CMS that is what GIMP does. I think it is better anyway than Adobe CMS, unless when on Apple and thus using Apple CMS.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 19, 2022 Mar 19, 2022

Copy link to clipboard

Copied

I'm not the one writing the ICCP here, I'm trying to read it from Photohshops PNG output and from other applications and determine if it's sRGB or not.  So your advice on whether to write sRGB, cHRM, gAMA doesn't apply.  

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 19, 2022 Mar 19, 2022

Copy link to clipboard

Copied

LATEST

How icc profile works and what is true srgb profile is very well described here: https://photosauce.net/blog/post/making-a-minimal-srgb-icc-profile-part-4-final-results

 

It is very complex. Photoshop should have just used srgb chunk 🙂

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines