5

I'm experiencing a strange effect where an image transform is causing my images to turn very dark when compared to their originals. I have ImageMagick and gd installed. The images are all sRGB. Some have Adobe RGB profiles, some have no profiles.

The image transform makes the jpeg 1200px wide, height auto, quality high. Not sure what could be causing the problem.

4
  • 3
    What image driver are you using, gd or imagick? What colorspace is the original file in? Does it have a color profile? Mar 31, 2016 at 21:30
  • 2
    @AndréElvan might be onto something. There's this new preserveColorProfile config setting that might solve it?
    – carlcs
    Mar 31, 2016 at 21:38
  • 2
    Yeah, 'preserveImageColorProfiles' => true could solve it. But ideally, the file should have been saved for web without a profile, or srgb, so.. But there's also this weird thing where old versions of ImageMagick would make images a lot darker when converting from a colorspace without dynamic color range, to a normal jpeg (which has dynamic color space). But, I guess that's a more obscure case. Mar 31, 2016 at 22:37
  • @AndréElvan I have both gd and imagick installed. The file is sRGB. As you suspected 'preserveImageColorProfiles' => true did solve the problem. Thanks. Apr 1, 2016 at 8:01

2 Answers 2

7

Setting 'preserveImageColorProfiles' => true, in craft/config/general.php solved the problem.

https://craftcms.com/docs/config-settings#preserveImageColorProfiles

Note that you need to be running at least Craft 2.6.2778 for this config setting to work.

2

The file probably has a color profile, which gets removed by Craft by default. You can tell Craft to preserve the color profile by setting the preserveImageColorProfiles in your config file.

'preserveImageColorProfiles' => true

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.