Skip to content

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