Vikestart Posted April 5, 2017 Share Posted April 5, 2017 What is up with the quality of images when they are resized? Is there anything that can be done to increase the quality? Compare the two: Original: Resized (barely smaller): The quality loss is enormeous, especially in dark areas of the image. Link to comment Share on other sites More sharing options...
Robin S Posted April 5, 2017 Share Posted April 5, 2017 1 hour ago, Vikestart said: What is up with the quality of images when they are resized? What's up is that the size() method accepts a 'quality' setting in its $options array: https://processwire.com/api/ref/pageimage/size/ And you can define the default quality setting used for the image sizer in /site/config.php via $config->imageSizerOptions: https://processwire.com/api/ref/config/ 4 Link to comment Share on other sites More sharing options...
Vikestart Posted April 5, 2017 Author Share Posted April 5, 2017 18 minutes ago, Robin S said: What's up is that the size() method accepts a 'quality' setting in its $options array: https://processwire.com/api/ref/pageimage/size/ And you can define the default quality setting used for the image sizer in /site/config.php via $config->imageSizerOptions: https://processwire.com/api/ref/config/ Oooh, I didn't even know about that config.php file and that list of settings you linked to is certainly useful. Still getting to know Processwire. I'll just dive in and see where this gets me Thanks! Link to comment Share on other sites More sharing options...
Christophe Posted April 5, 2017 Share Posted April 5, 2017 (edited) By default PHP's bundled GD 2 library is used. If you're using a recent ProcessWire 3 version, ImageMagick is also supported (if you can have it installed on your server of course). Perhaps you could have better results. https://processwire.com/blog/posts/processwire-3.0.10-expands-image-resize-options/ NB: in /wire/config.php you can also see some settings, copy them to /site/config.php and modify them... Edited April 5, 2017 by Christophe 4 Link to comment Share on other sites More sharing options...
horst Posted April 5, 2017 Share Posted April 5, 2017 ..., and you should enable the IMagick Imagesizer Engine if your server supports it! (under PW 3) ..., and additionally to the quality-value, you can try out differend sharpening values (none, soft, medium, strong) 3 Link to comment Share on other sites More sharing options...
Vikestart Posted April 5, 2017 Author Share Posted April 5, 2017 Setting the defaultGamma option to 0.5 instead of the default 2.0 seems to have fixed the image quality. $config->imageSizerOptions = array('upscaling' => true, 'cropping' => true, 'quality' => 100, 'sharpening' => 'none', 'defaultGamma' => 0.5); Thanks for the help everyone! 2 1 Link to comment Share on other sites More sharing options...
Peter Knight Posted December 7, 2018 Share Posted December 7, 2018 On 4/6/2017 at 12:43 AM, Vikestart said: Setting the defaultGamma option to 0.5 instead of the default 2.0 seems to have fixed the image quality. $config->imageSizerOptions = array('upscaling' => true, 'cropping' => true, 'quality' => 100, 'sharpening' => 'none', 'defaultGamma' => 0.5); Thanks for the help everyone! @Vikestart Did you paste this from your config in /wire/ to your config file in /site/ ? Link to comment Share on other sites More sharing options...
Peter Knight Posted December 7, 2018 Share Posted December 7, 2018 Confirming this worked for me too. ? Link to comment Share on other sites More sharing options...
horst Posted December 7, 2018 Share Posted December 7, 2018 Have you also tried -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