Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
skiingdomo opened this issue Jun 14, 2021 · 2 comments

Comments

@skiingdomo
Copy link

skiingdomo commented Jun 14, 2021

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.

@oscarotero
Copy link
Owner

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)

@skiingdomo
Copy link
Author

I'll let you do it. :)

oscarotero added a commit that referenced this issue Jul 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants