Jump to content

ImageSizerOptions doesn't seem to work for gamma


Margie
 Share

Recommended Posts

Hi,

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.

242645489_ScreenShot2019-03-08at12_25_41pm.thumb.png.3de88cf502b74c0c8c68566ff501612d.png133132329_ScreenShot2019-03-08at12_26_22pm.thumb.png.0ab3bb17880b591fa1c213aa5ca9b0f0.png132891426_ScreenShot2019-03-08at12_30_08pm.thumb.png.8a94efd581faa972b3a3e685328afc48.png

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

Thanks!

Margaret

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.

Thanks!

Margaret

squirrels-apple-blossom-mother.jpg

Link to comment
Share on other sites

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

0.5
squirrels-apple-blossom-mother_jpg_10c867daeb1da81677dc67c1125e3dbe.400x0-u0i1s1q90f1.jpg.67525f3379b76a2069769da19ccf801b.jpg

4
squirrels-apple-blossom-mother_jpg_10c867daeb1da81677dc67c1125e3dbe_400x0-u0i1s1q90f1.400x0-u0i1s1q90f1.jpg.e13f4d206200a988f2095e5009b8fa60.jpg

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
 Share

  • Recently Browsing   0 members

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