Jump to:

23379 Posts in 18298 Topics by 2867 members

General Questions

SilverStripe Forums » General Questions » GD image desaturation

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

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

Page: 1
Go to End
Author Topic: 2272 Views
  • 1976
    Avatar
    Community Member
    5 Posts

    GD image desaturation Link to this post

    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.

    Cheers

  • Pigeon
    Avatar
    Community Member
    243 Posts

    Re: GD image desaturation Link to this post

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

    GD::set_default_quality(100);

    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.

  • banal
    Avatar
    Community Member
    901 Posts

    Re: GD image desaturation Link to this post

    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.

  • 1976
    Avatar
    Community Member
    5 Posts

    Re: GD image desaturation Link to this post

    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.

  • alirobe
    Avatar
    Community Member
    35 Posts

    Re: GD image desaturation Link to this post

    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.

  • banal
    Avatar
    Community Member
    901 Posts

    Re: GD image desaturation Link to this post

    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.

    2272 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.