Jump to content

ImageSizerOptions doesn't seem to work for gamma


Recommended Posts


I've noticed that the variations of the images on my site are darker/more saturated than the originals I'm uploading, I was using the default GD and have changed to ImageMagick but that hasn't made any difference (ImageMagick is definitely installed on the server).

(The site's not live yet so I have to rely on the screenshots below.)

I'm exporting the images from Lightroom, using the sRGB option. When I look at the original within the ProcessWire admin it looks fine, but the variations are darker.

I've also followed the advice in this post, including using Photoshop instead of Lightroom, but still haven't had any luck: $config->imageSizerOptions doesn't seem to do anything

I will confirm that I'm removing all variations via the page edit screen each time I've made a change.

I've added this line to my site/config.php:

$config->imageSizerOptions('defaultGamma', 0.5);

I've tried -1, 0.5, 4.0 - the variations are the same every time.

The only thing that has made any difference is commenting out line 246 in ImageSizerEngineIMagick.module, as advised by @horst in another forum post. However, the result is then too washed out. I'd have thought setting the default gamma to -1 would have the same effect?

The picture on the left is the original, as viewed in the PW admin. The middle picture is the variation visible on the edit screen, and the same regardless of what settings I place in the config file. The picture on the right is the variation visible on the edit screen, when line 246 is commented out.


Am I missing something or is there a bug that's causing this config option to be ignored?



Link to comment
Share on other sites

52 minutes ago, Robin S said:

Hi Margaret,

Maybe you could attach or link to one of the original images that is exhibiting the problem to see if anyone else can reproduce the issue?

Sure, here's the jpg file as exported from Lightroom and uploaded to PW.

I should add I'm running PW 3.0.123.




Link to comment
Share on other sites

I was able to see a difference with defaultGamma set to 0.5 versus 4.



But only for ImageSizerEngineGD (the PW default sizer engine). I don't see defaultGamma used anywhere inside ImageSizerEngineImagick. Maybe @horst can confirm if defaultGamma applies to ImageSizerEngineImagick or not.

Link to comment
Share on other sites

Thanks @Robin S for checking this out.

I decided to uninstall ImageMagick and try again just using GD. Oddly this time when I set the gamma to 4.0 I get something similar to what you've shared above. That didn't work before... The only thing I changed was the position of the $config->imageSizerOptions('defaultGamma', 0.5); line in the config file - previously I had it near the top whereas now it's at the bottom. I wouldn't have thought that would make any difference. I don't know, I must have been doing something wrong prior to installing ImageMagick.

However, even when set at 0.5 or -1 the images are still a bit darker than the original. I might just have to change my adjustment settings in Lightroom and re-export so they're all a bit lighter to start with. I'm the only one who'll see the originals anyway.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...