Keeping color-profile when using resize()


Is there any option to keep the right color-profile when using resize() on an image? I did not find any documentation about this in the docs.

Now, when I resize any image, the color of the generated thumbnail does not match the original file.


Which driver are you using? GD library or ImageMagick? The IM driver strips the color profile and you can prevent that with a custom driver.

Nothing changed in the configuration, so I guess I’m using the GD library (based on the information on this page).

Is creating a custom driver the only option or is there some setting available in the Kirby config.php?

I think the driver is your only option (as you can see in the code I linked to above, the -strip option is not added conditionally), the only configurable options are width, height, grayscales, blur and crop.

You can find an example of registering a custom thumb driver here:

Thanks! I will give it a try.

Did you find a (reusable) solution? :relieved:

This is a common problem when working on websites with color sensitive images (e. g. photography portfolios). Photographers rarely use sRGB, but AdobeRGB or other color profiles for their images.

How do others deal with it? Making the sRGB profile a necessity when uploading images?


I still need to look into this. If I have a solution, I will post it!

1 Like

Hey @jorisvdz , would also be curious about your solution. Currently working on a photographers website :slight_smile:

Unfortunately I never found a working solution.

Since Kirby 3.6.1, Kirby keeps the color-profile when creating thumbs.

Hi @mrflix, Is this for GD too?

No, GD doesn’t support color profiles. Source

Thanks @mrflix. I have a requirement to use GD but client is noticing color change with the thumbs produced. Any work arounds for this that you know of? Thanks in advance.

With my clients the only color-profile problem I encountered was that they uploaded photos fresh from the camera in the adobe-rgb profile. These clients had Photoshop experience, so I told them to convert the photos to srgb before uploading. I converted the already uploaded photos for them using Imagemagick’s mogrify on my machine:

find . -name '*.jpg' -execdir mogrify -profile ~/Material/sRGB2014.icc {} \;

You can download sRGB2014.icc here: sRGB profiles (you have to scroll down and accept the licensing terms.