imagecow icon indicating copy to clipboard operation
imagecow copied to clipboard

(Imagick) Suggestion to allow setting filter type and blur for better resize quality.

Open skiingdomo opened this issue 3 years ago • 2 comments

Hi,

Just a suggestion for the Imagick implementation in imagecow. Specifically, in Libs/Imagick.php, on line 229 where it uses scaleImage():

if ($this->image->scaleImage($width, $height) !== true) { https://www.php.net/manual/en/imagick.scaleimage.php

ScaleImage() does not allow configuration of the filter or blur setting. The function resizeImage() is very similar but allows for changing these settings. https://www.php.net/manual/en/imagick.resizeimage.php

For example we set the filter to Lanczos, and blur to 0.8: if ($this->image->resizeImage($width, $height, \Imagick::FILTER_LANCZOS, 0.8) !== true) {

This vastly improved the quality of resized images. Especially ones with text on them.

skiingdomo avatar Jun 14 '21 04:06 skiingdomo

Hi, thanks for the suggestion, I really like it! Do you want to work on a pull request? (If you don't want, don't worry, I can do it)

oscarotero avatar Jun 14 '21 10:06 oscarotero

I'll let you do it. :)

skiingdomo avatar Jun 15 '21 00:06 skiingdomo