vipsdisp icon indicating copy to clipboard operation
vipsdisp copied to clipboard

Sample problematic HDR JPEG XL, PNG and JPG files

Open o-l-a-v opened this issue 11 months ago • 4 comments

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 avatar Jan 19 '25 16:01 o-l-a-v

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

jonnyawsom3 avatar Jan 19 '25 17:01 jonnyawsom3

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 https://github.com/libvips/libvips/issues/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;

kleisauke avatar Jan 19 '25 17:01 kleisauke

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. 😅

o-l-a-v avatar Jan 19 '25 19:01 o-l-a-v

PR https://github.com/libvips/libvips/pull/4347 should fix the issue for XYB JPEGs.

kleisauke avatar Jan 20 '25 11:01 kleisauke

We now have libvips 8.17 and vipsdisp 4.0, so I think this is all working.

jcupitt avatar Jun 21 '25 03:06 jcupitt