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

Fix for blurry images from WEBP input and small output dimensions #368

Merged
merged 2 commits into from
Aug 7, 2021

Conversation

totallyunknown
Copy link
Contributor

@totallyunknown totallyunknown commented Mar 31, 2021

This will fix blurry images if the input is in webp format and the output is relativly small in his dimensions. This will fix issues #220, #339 makes #222 obsolet. This will also fix h2non/imaginary#240.

The underlying issue is, that the factor comming out from supportsShrinkOnLoad is too high. transformImage has then a too large shrink and the image gets blurred.

I have no good idea, how to put that in a unit test, since the image output may differ on plattforms.

I did some manual testing with a lot of different output resolutions and compared the old with the new code. All blurring is gone.

shrinkOnload uses for WEBP now the same logic as for JPEG.

@colin-lee
Copy link

good job, that helps me. please merge it

@totallyunknown
Copy link
Contributor Author

Looks like this project is abandoned...

@colin-lee
Copy link

bad news, there are so many PR waiting for merge。
I compile bimg with your patch, then update imaginary.
It fixed the blurry images.
many thx

@wuzhihui1123
Copy link

wuzhihui1123 commented Jul 29, 2021

good job, that helps me. please merge it
@h2non

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

blurred image when webp image gets shrinked
4 participants