Skip to content

Request to add deblocking param for webp images #1803

Description

I'm producing webp images with Thumbor v6.0.1 https://github.com/thumbor/thumbor/tree/6.0.1which uses Pillow version > 3.0. Normally this works very well but there are some images which webp's deblocking (https://developers.google.com/speed/webp/docs/cwebp#options see -f option) functionality completely ruins an images. Not sure what webp default value for deblocking is but I used cwebp with deblocking set to 0 and the resulting image was perfectly fine.

Source image:
braincave

Webp image produced by Thumbor (converted back to PNG for browser compatibility):
braincave_default_with_deblocking

Webp image produced by cwebp with deblocking set to zero (converted back to PNG for browser compatibility):
braincave_withou_deblocking

This pattern of webp's deblocking slaughtering "low poly" / "pixel" and other blocky art style images has been observed quite a few times via our Thumbor setup. I can make a PR on Thumbor's side if Pillow can add support for passing an option for deblocking. Other options like -af aka auto-filter would be great too, but deblocking is a top priority for me.

If a code bounty would help motivate, I'd definitely be willing to contribute. I'd be happy to contribute myself but I really don't know where to get started, others would likely be far more productive. However, if that's the only option please point me in the right direction and I'll see what I can do.

Lastly, if there is a way that I could build Pillow via some sort of custom webp library that defaults to a level of 0 deblocking, I could also try that.

Any assistance is GREATLY appreciated. Thank you

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions