Comments (5)
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.
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.
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.
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.
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)
- Quantization table with index 0 not found HOT 8
- Applications shouldn't abort while reading jpegs HOT 1
- 请教个问题! HOT 3
- Static libjpeg
- JXL input is supported by cjpegli, but not listed in the help
- cjxl fails on "MotionPhoto" jpegs HOT 1
- 32bit Float Density Regression HOT 3
- Add Adobe APP14 tag to JPEG images with specific colorspaces (fix XYB appearance in most apps)
- djpegli should decode xyb-jpeg to rgb-png HOT 2
- Lossy cjxl with Alpha channel not using --keep_invisible=0 as default HOT 4
- Losslessly converting color JPEG to grayscale JXL HOT 4
- The effort documentation is outdated
- API for region of interest decoding
- Regression in lossy nonphotographic images HOT 3
- faster_decoding=1 or faster_decoding=2 has extremely bad size with lossless images.
- cjpegli: Pass on the DPI resolution into a JFIF marker HOT 2
- Unable to transcode a CMYK jpeg to jxl HOT 1
- cjpegli ignores sRGB ICC profiles HOT 3
- Typos in color_encoding.h HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libjxl.