Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

GD image desaturation

Go to End

6 Posts   3030 Views


Community Member, 5 Posts

8 December 2009 at 8:31am

I have a client who is a photographer and he's complaining that when he uploads images into a gallery they appear desaturated.

I have checked in the assets folder and compared the original and the resized versions and he is right, there's about a 10% desaturation.

This wouldn't normally be an issue but as a photographer he finds it unacceptable.

Is there a setting in GD.php I can change?

Any urgent suggestions gratefully received.



Community Member, 253 Posts

8 December 2009 at 10:56am

Depending on the version of SS you are running, setting:


In your mysite/_config.php file should fix the problem. I think the default quality is about 70 (scale of 1-100). 100 would seem a bit unnessacery to me, and would go for 85 tops. But have a play and see if it fixes it.


Community Member, 904 Posts

8 December 2009 at 11:33am

I don't think that setting the GD quality will help all that much, because the image will be recompressed and lose quality, no matter how high the JPG quality setting is.
Since your client is a photographer, you might want to suggest that he prepares his images in the right dimensions and you output the original (uploaded) file in the template instead of a resized version.
I have clients like yours and I usually use a custom image subclass that only performs image recalculation if the requested dimensions are other than the source file.


Community Member, 5 Posts

9 December 2009 at 8:57am

You're right banal, setting the jpg quality makes no difference to the colour shift. It seems to be a GD related problem though as I have seen complaints from other open source application users such as Wordpress with the exact same issue.

There have been some requests on this forum for a change to ImageMagick rather than GD which might be justified if there's no way to get the same levels/saturation as the original.

I am using the gallery module and have chosen to set the large lightwindow popup image to show the original image to get around this. My client will just have to resize these in Photoshop. Unfortunately the preview images will still have a lack of saturation as they need to be resized.


Community Member, 35 Posts

11 December 2009 at 6:12pm

If you are both on Macs + Safari, this could be due to loss of color profiles embedded in the image EXIF data. Test this on a Windows PC and see if the results are the same.


Community Member, 904 Posts

11 December 2009 at 9:16pm

True. Forgot about color profiles.
If saving from Photoshop, always use "Save for Web". This will remove all embedded Profiles and images will be generally smaller in file size.