Giter Club home page Giter Club logo

Comments (5)

jonsneyers avatar jonsneyers commented on June 2, 2024 1

Which viewer are you using?
There could be an issue with your viewer.

The original PNG file does not have an ICC profile but it does have cHRM and gAMA chunks that define the color primaries to be those of sRGB and the transfer curve being a gamma curve; however many viewers ignore that information and either assume it is in sRGB space (that is, with the sRGB transfer curve and not a simple gamma curve) or in display space.

When viewing both the PNG and the lossless JXL in Thorium, they look identical. This is correct behavior. The sample values are identical, and the colorspace of the JXL file is equal to the colorspace defined in the PNG file: RGB, D65, sRGB primaries, gamma(0.454550) transfer function.

When I view them in Safari, the JXL looks identical to what I see in Thorium, but the PNG looks a bit darker — presumably Safari is rendering the PNG as if it uses the sRGB transfer curve. This is common behavior: ImageMagick makes the same assumption that while the PNG according to the PNG spec is not in sRGB space, it should still be treated as if it is, for some reason.

When I view the PNG in Preview, it looks the same as in Safari: slightly too dark. The inspector window says the colorspace of the image is sRGB (which is wrong).

When I view the JXL in Preview, it looks like in your screenshot: more noticeable orange/blue colors, and the inspector window claiming the color profile is named "QuickTime 'nclc' Video (1,2,2)" (which is wrong).

So both the PNG and the JXL are rendered wrong in Preview; in Safari the PNG is rendered incorrectly but the JXL is rendered correctly.

Unless I am mistaken, this is not a bug in libjxl or in cjxl, but in viewer applications that handle the colorspace incorrectly (for both PNG and JXL).

from libjxl.

Bustycat avatar Bustycat commented on June 2, 2024

How did you generate the original PNG file? The resulted JPEG XL file contains a colour profile "QuickTime 'nclc' Video (1,2,2)", and using djxl to it will become a PNG file containing a colour profile "RGB_D65_SRG_Rel_g0.45455". I tested on macOS 14.4.1 too.

from libjxl.

Qhilm avatar Qhilm commented on June 2, 2024

The png is converted from a tiff file on macOS, then I cropped it.

Visually, on the Mac, original tiff, png and cropped png look identical (in the cropped region).

The original png contains personal information, hence I can only distribute a crop.

But how could a colour profile cause some orange pixels to become blue? I'm really not an expert on this.

from libjxl.

Qhilm avatar Qhilm commented on June 2, 2024

You are correct, I apologise, it is Apple's preview which is buggy, I do not have this issue in other viewers such as safari or pixelmator. I should have tested this, I didn't think the colours could be that much off because of a incorrectly interpreted color space...

from libjxl.

jonsneyers avatar jonsneyers commented on June 2, 2024

I opened an issue using Apple's Feedback Assistant, but I guess it wouldn't hurt if others affected by this bug also report it so it gets prioritized correctly.

from libjxl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.