dreerr Posted December 3, 2017 Share Posted December 3, 2017 Attached you see a comparison of a JPG I uploaded and one time applied ['quality'=>75] compared to ['quality'=>100] in the file size the files are 38KB resp. 245KB but on both you can find these artifacts in the blue and red parts of the image. Any idea to avoid them or try a different method of resizing? Thanks, D. Link to comment Share on other sites More sharing options...
adrian Posted December 3, 2017 Share Posted December 3, 2017 If you have imagick available on your server, please try installing the core module: ImageSizerEngineIMagick and if that helps. Link to comment Share on other sites More sharing options...
PWaddict Posted December 4, 2017 Share Posted December 4, 2017 @dreerr I had a similar problem in the past and I fixed it by disabling the gamma correction. On your site/config.php add this: $config->imageSizerOptions = array( 'defaultGamma' => -1, // defaultGamma: 0.5 to 4.0 or -1 to disable gamma correction (default=2.0) ); 3 Link to comment Share on other sites More sharing options...
horst Posted December 4, 2017 Share Posted December 4, 2017 9 hours ago, PWaddict said: @dreerr I had a similar problem in the past and I fixed it by disabling the gamma correction. On your site/config.php add this: $config->imageSizerOptions = array( 'defaultGamma' => -1, // defaultGamma: 0.5 to 4.0 or -1 to disable gamma correction (default=2.0) ); this is really a bad idea! with this, you wibes out all other properties of the imgaeSizerOptions: before your correction, the imageSizerOptions array contain items for sharpening, quality gamma etc. After your correction, the defaultGamma is the only one item. All others are wiped out! PLEASE, repeat all other items with there respective values, or use array_merge() !! $config->imageSizerOptions = array_merge( $config->imageSizerOptions, // all items from wire/config array( // overwrite specific items 'defaultGamma' => -1, 'sharpening' => 'medium' ) ); -------- But in @dreerr s case, I can't think of that this is the issue / solution. Disabling "defaultGamma" is usefull if you gets clippings in dark to black regions. According to what @dreerr describes, my first question is: "How does the original image looks like?" If this already has arctefacts, you ever will get artefacts also in quality 100. Where does the source- or master image comes from? What processes gets it passed through before the upload to PW? Any restrictions on upload? (max size?) Maybe you can provide a link to that image online, or via PM to me? 4 Link to comment Share on other sites More sharing options...
heldercervantes Posted December 4, 2017 Share Posted December 4, 2017 11 hours ago, adrian said: If you have imagick available on your server, please try installing the core module: ImageSizerEngineIMagick and if that helps. This is what I'd try. I've had this problem in the past, but honestly never did anything about it. The next time I see this happen, I'm going to try imagemagick. It seems that GD makes colour bands when it processes the image, which sucks. It depends on the image, if there's a smooth gradient, you'll see it. Link to comment Share on other sites More sharing options...
PWaddict Posted December 4, 2017 Share Posted December 4, 2017 @horst Actually this is how I have it. Is this really bad? $config->imageSizerOptions = array( 'cropping' => 'north', // Crop North (top), may also be just "n". 'sharpening' => 'none', // sharpening: none | soft | medium | strong 'quality' => 80, // quality: 1-100 where higher is better but bigger 'defaultGamma' => -1, // defaultGamma: 0.5 to 4.0 or -1 to disable gamma correction (default=2.0) ); On my previous post I left only defaultGamma just to see @dreerr the actual value I used to fix the problem. Link to comment Share on other sites More sharing options...
SamC Posted December 4, 2017 Share Posted December 4, 2017 @PWaddict maybe take a look at this thread: It was very helpful to me. Link to comment Share on other sites More sharing options...
dreerr Posted December 6, 2017 Author Share Posted December 6, 2017 THanks a lot the gamma setting solved the issue! 2 Link to comment Share on other sites More sharing options...
horst Posted December 6, 2017 Share Posted December 6, 2017 On 12/4/2017 at 1:44 PM, PWaddict said: @horst Actually this is how I have it. Is this really bad? $config->imageSizerOptions = array( 'cropping' => 'north', // Crop North (top), may also be just "n". 'sharpening' => 'none', // sharpening: none | soft | medium | strong 'quality' => 80, // quality: 1-100 where higher is better but bigger 'defaultGamma' => -1, // defaultGamma: 0.5 to 4.0 or -1 to disable gamma correction (default=2.0) ); On my previous post I left only defaultGamma just to see @dreerr the actual value I used to fix the problem. If you have an array from wire/config.php like the imageSizerOptions: $config->adminThumbOptions = array( 'width' => 0, // max width of admin thumbnail or 0 for proportional to height (@deprecated, for legacy use) 'height' => 100, // max height of admin thumbnail or 0 for proportional to width (@deprecated, for legacy use) 'gridSize' => 130, // Squared grid size for images (replaces the 'width' and 'height' settings) 'scale' => 1, // admin thumb scale (1=allow hidpi, 0.5=always hidpi, 1.0=force non-hidpi) 'upscaling' => false, 'cropping' => true, 'autoRotation' => true, // automatically correct orientation? 'sharpening' => 'soft', // sharpening: none | soft | medium | strong 'quality' => 90, 'suffix' => '', ); and you then attach a new array to $config->imageSizerOptions with a smaller set of key/value pairs, you wipe out: width, height, gridSize, scale, upscaling, autoRotation, suffix. Besides using PHP function array_merge, you also may use this to override your desired keys without deleting the others: (THE FOLLOWING IS WRONG) Spoiler $config->imageSizerOptions['cropping'] = 'north'; $config->imageSizerOptions['sharpening'] = 'none'; $config->imageSizerOptions['quality'] = 80; $config->imageSizerOptions['defaultGamma'] = -1; 1 Link to comment Share on other sites More sharing options...
Robin S Posted December 7, 2017 Share Posted December 7, 2017 2 hours ago, horst said: Besides using PHP function array_merge, you also may use this to override your desired keys without deleting the others: $config->imageSizerOptions['cropping'] = 'north'; $config->imageSizerOptions['sharpening'] = 'none'; $config->imageSizerOptions['quality'] = 80; $config->imageSizerOptions['defaultGamma'] = -1; You would think this would work, but if you test it I think you'll find that individual keys set like this have no effect. However, Ryan recently alerted me to this working alternative for setting individual keys: $config->imageSizerOptions('cropping', 'north'); 4 1 Link to comment Share on other sites More sharing options...
PWaddict Posted December 7, 2017 Share Posted December 7, 2017 I just test it too and it doesn't work. I will try Ryan's method. 1 Link to comment Share on other sites More sharing options...
PWaddict Posted December 7, 2017 Share Posted December 7, 2017 Yep @ryan's method working perfect. $config->imageSizerOptions('cropping', 'north'); $config->imageSizerOptions('sharpening', 'none'); $config->imageSizerOptions('quality', 80); $config->imageSizerOptions('defaultGamma', -1); 3 1 Link to comment Share on other sites More sharing options...
horst Posted December 9, 2017 Share Posted December 9, 2017 Yes, with the single version I was wrong. (Should not answer without testing, when its late and I'm tired) The only solutions to override single properties without dropping others, is ryans method or array_merge(). 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now