Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sample problematic HDR JPEG XL, PNG and JPG files #42

Open
o-l-a-v opened this issue Jan 19, 2025 · 4 comments
Open

Sample problematic HDR JPEG XL, PNG and JPG files #42

o-l-a-v opened this issue Jan 19, 2025 · 4 comments

Comments

@o-l-a-v
Copy link

o-l-a-v commented Jan 19, 2025

Here are three problematic image files, found here:

Original JPEG XL file can be found in the last URL ^. PNG and JPEG was created with JPEG XL v0.11.1.

  • PNG was created with: djxl imagetest15-Q70.jxl output.png
  • JPEG with: cjpegli imagetest15-Q70.jxl output.jpg --quality=90 --xyb --chroma_subsampling=444

Screenshot with vipsdisp v3.1.0 on Windows:

Image

JXL and PNG (left and center) should be brighter. The JPG (right) is really messed up.

  • JPEG is XYB color space and embedded ICC, I think (i'm not an expert on this).
@o-l-a-v o-l-a-v changed the title Problematic HDR JPEG XL, PNG and JPG file Sample problematic HDR JPEG XL, PNG and JPG files Jan 19, 2025
@jonnyawsom3
Copy link

Seems color management isn't working, the XYB JPEG is a common sight where the ICC is unsupported

@kleisauke
Copy link
Contributor

The JPEG XL and PNG images display correctly when I select the Enable colour management-option in the control menu.
image

The issue with XYB JPEGs will eventually be resolved (see libvips/libvips#3475), as those ICC profiles do not support the relative intent that libvips picks by default. As a possible workaround, we could always use the perceptual intent in vipsdisp. For example:

--- a/src/tilesource.c
+++ b/src/tilesource.c
@@ -538,7 +538,9 @@ tilesource_rgb_image(Tilesource *tilesource, VipsImage *in)
 	 */
 	if (tilesource->active &&
 		tilesource->icc) {
-		if (vips_icc_transform(image, &x, "srgb", NULL))
+		if (vips_icc_transform(image, &x, "srgb",
+				"intent", VIPS_INTENT_PERCEPTUAL,
+				NULL))
 			return NULL;
 		VIPS_UNREF(image);
 		image = x;

@o-l-a-v
Copy link
Author

o-l-a-v commented Jan 19, 2025

Thanks @kleisauke. I actually looked for color management options, but could not find it in the only visible hamburger menu that is visible by default. 😅

@kleisauke
Copy link
Contributor

PR libvips/libvips#4347 should fix the issue for XYB JPEGs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants