Kirby CMS Thumbnail API reduces the saturation of images

In both Kirby CMS 3.5.6 and 3.6 I’ve tested the Thumbnail API to serve images with a srcset pre-defined in the config.php -> thumbs object. The original file through image.jpg delivers an asset similar with the original file with the correct balance of colors. While the ones generated through Thumbnails API image-400x.jpg have a reduced saturation than the original.

I’ve temporarily ignored this problem by increasing the saturation of all images via CSS filter: saturate(1.30); but I don’t like this solution as I would have some original files being delivered resized from the Thumbnails API, and others the original file.

I’ve tried:

  • Smaller Images
  • Different Format
  • Different Thumbs Driver (im, gd)
  • Interlace on and off

Maybe I’m doing something wrong here, this is an amazing feature by Kirby CMS it works very smoothly and it’s amazingly intuitive, I would just like to see this fixed.

Thanks a lot in advance!

Hm, 3.6.1.x should preserve color profiles as per this PR, at least for jpeg, if I understand it correctly:

(And I would expect the saturation issue to be due to missing color profiles). This requires the IM driver though.

That worked, wasn’t aware that might be the color profiles :man_facepalming:

Thank you so much (:

Seems this is still a thing?

The images are all in Jpg with color profile “Display P3” on Mac.
All generated webp images have this washed out effect.

comparsion_jpg_webp

My images are renderd with the thumb() function and have this as default setting in the config:

'thumbs' => [
  'format' => 'webp',
  'presets' => [
    'default' => ['width' => 1200, 'quality' => 60]
  ]
],

Any recommendations?

Some suggestions:

  • try using ImageMagick instead of gd, that should have better support of colors
  • Upload the images as sRGB directly, 95% of your users will always see them washed out anyway
  • don’t convert them to webp (I think webp and png both only support sRGB as that’s the only color profile considered „web-safe“)
  1. Will look into it, but seems on Ionos shared webhosting there is only GD.
  2. No option - Because the client has a strict workflow
  3. No option - Webp is much more efficient than others