Plugin

Developer
Supported

CE Image

ExpressionEngine 1.x, ExpressionEngine 2, ExpressionEngine 3

Back to this add-on's main page
View Other Add-ons From Causing Effect

     

You must be logged in to post.

Color profiles? (Accepted)

Feature Request

Adam Stoddard
Adam Stoddard

I’ve noticed that the colors of the generated images are much more desaturated as compared to the originals.  An image saved for web out of Photoshop compared to it’s cached version shows some pretty obvious color degradation on the cached version.  Looking at the metadata, I noticed that the color profile isn’t present in cached version. Any way around this issue?

Causing Effect - Aaron Waldon
# 1
Developer
Causing Effect - Aaron Waldon

Hi Adam!

The GD library (what PHP relies on to do the image manipulations for CE Image) does not have support for color profiles from what I can tell. However, color profile support is fairly unreliable in browsers anyway (see http://www.northlight-images.co.uk/article_pages/web-browser-color-management.html and http://www.zenphoto.org/support/topic.php?id=4937).

It appears that ImageMagick and Gimp extensions (for PHP) support color profiles, but they are not as widely supported. So unfortunately, for the time being, my hands are tied on this one…

You can more or less get around the problem by changing your Photoshop colorspace from RGB to sRGB (see this post for more detail: http://creativebits.org/photoshop_-_save_for_web_problem).

Regards,

Aaron

Superbia
# 2
Superbia

It’s probably because your original images are in the Adobe RGB colourspace which contains a lot more colour information than sRGB. When you save for web in Photoshop it automatically converts the image to sRGB for you, preserving the colours.

I don’t think there’s much in the way of colour profile support in GD. You can do colour profile conversions in ImageMagick with littleCMS. I’ve set this up before in a custom CMS. You do the conversion and then strip the profile so the image file size is reduced.

I would love an image processing plugin for EE that supports ImageMagick.

Superbia
# 3
Superbia

Ha ha, too fast!

Causing Effect - Aaron Waldon
# 4
Developer
Causing Effect - Aaron Waldon

Thanks for jumping in Superbia! I think that profile to sRBG conversion support might be a little out of the scope of this plugin. I want CE Image to support the largest audience possible by using GD, for the time being anyway. :)

Superbia
# 5
Superbia

No problem :) Thanks for all your work on CE, it’s a must have for all of the EE sites I build.

Paradise
# 6
Paradise

Hi Arron,

i wrote you that email because of the blurry watermarks and you pointed me to this thread.
My Photoshop is allways set to sRGB if i save for the web.
It makes no difference if i set it or not :-(

Causing Effect - Aaron Waldon
# 7
Developer
Causing Effect - Aaron Waldon

@Paradise: I just responded to your email.

Jonathan
# 8
Jonathan

I have a client who’s a professional photographer and uses a wide-gamut display that’s capable of displaying 99% of the AdobeRGB color gamut space.

Now he converts all his photos into sRGB before uploading to his EE website, but because the CE image plugin strips all color profile information (as far as I know), the generated images display less saturated than should be on his wide-gamut screen!

Now not many people have a wide gamut display (yet), so generated images display more or less correct on a ‘normal’ display, because it’s more or less only capable of displaying the sRGB color space, that coincidently matches the original sRGB but now color-profile-less generated images!

But now that almost all modern browsers/operating systems support color profiles and wide-gamut displays (will) become more common, it would be really great if you could look into this (again) and add support for color profiles (if necessary only for servers that support ImageMagick and/or GD)!

Thanks,
Jonathan

Causing Effect - Aaron Waldon
# 9
Developer
Causing Effect - Aaron Waldon

Hi Jonathan!

Saving in sRGB is the right way to go, as it minimizes the conflicts when PHP strips out the color profile data. That being said, the jpeg images output using the PHP GD library are almost always a little (and sometimes a lot) off to the trained eye. Reds and pinks seem to be especially bad (even when the quality is set to 100%). If you save the image to a non-lossy image format like png (using the save_type parameter), the color fidelity is much higher, but unfortunately the file size is too.

I will definately consider talking another look at ImageMagic. If it is something that I can add in with a relatively small amount of code, I will (when I get the chance). However, the vast majority of CE Image users don’t and probably won’t have ImageMagic installed, so I may decide not to add in this feature if it has a negative impact on speed or will add significantly to overall file size…

Jonathan
# 10
Jonathan

Hi Aaron,

Thanks for your reply.

It would be really great if you can have another look at ImageMagic and (the preservation of) color profile data. I understand that it’s not (necessary) for everybody (maybe an advanced config variable?), but it can become more relevant in the (near) future if and when wide-gamut displays become more mainstream. But it already matters now when you deal with a professional photographer as a client ;-)

Please keep me/us posted (here or on twitter) about any progression and/or decision you make in this ‘colorful’ matter.

Thanks,
Jonathan

Tyssen
# 11
Tyssen

Hi Aaron,

Just wondering if there’s been any updates to the way CE Image deals with colour profiles since this thread was first created?

jdaalder
# 12
jdaalder

Just jumping on board because I am interested too.

Causing Effect - Aaron Waldon
# 13
Developer
Causing Effect - Aaron Waldon

Hi guys!

It is my understanding that there is no way to change how the GD library handles color profiles. It simply strips them out.

I have actually written an add-on that basically implements the vast majority of Imagick commands. I use it in the wild in a couple of places. It works well, but I got feedback that it would be better if I combined it to work with the same syntax and options as CE Image. The only issue there is that CE Image has a lot of GD specific functionality that ImageMagick does not have, and vice-versa. I have written several image manipulation classes that have a consistent API between ImageMagick, Imagick, and the GD library. I really just need to sit down and wrap them in an add-on with all of the stability, features, and years of feedback that I’ve received with CE Image. Color profiles just haven’t been a huge priority, as very few users have requested an update on this feature (there always seem to be bigger fish to fry).

I’m quite busy for the next few weeks, but I’ll see if I can get my hybrid creation released. In the meantime, if you have a project that is in emergency need of image profile correction, shoot an email to me at software at causingeffect.com.

Lulu
# 14
Lulu

Sorry for bumping this post but I actually just started searching for a reason why all my photo’s look so dull and came across this post.
I first thought that CE Image was using what ever image library EE was using so I set EE to use ImageMagick. Unfortunately thats not the case.
I just hope that ImageMagic will solve the problem :)

jphansen
# 15
jphansen

I’d also like this preservation of color saturation if it ever becomes and option.

Going to check CE Image documentation for saturation options. Maybe add some?