weserv / images

Source code of wsrv.nl (formerly images.weserv.nl), to be used on your own server(s).
https://wsrv.nl/
BSD 3-Clause "New" or "Revised" License
1.84k stars 188 forks source link

webP output is always lossy and cannot be requested as lossless #386

Closed haynzz closed 3 months ago

haynzz commented 10 months ago

This seems to be the default behavior of libvips and you need to explicitly pass lossless as a parameter. Currently there is not option to pass this param.

&q=100 does not yield the same results.

This is especially relevant for animated webP as their lossy versions are rarely appealing to the eye.

kleisauke commented 10 months ago

Would adding a new parameter to control this (e.g. &ll) work for you?

Let's mark this as an enhancement, I think it should be straightforward to add code-wise.

haynzz commented 10 months ago

I think that would be the suitable solution.

kleisauke commented 10 months ago

This has been implemented with commit 0674c39993f2508343be6a8493feb93ae10e8bf3, which has just been rolled out to production. Thanks for reporting this!

Documentation will be updated later to reflect this.

haynzz commented 10 months ago

Wow! This was quick. I did not expect this. Can you help me find out which Release has this change now?

kleisauke commented 9 months ago

@haynzz You can find it in the latest pre-built Docker image at ghcr.io/weserv/images:5.x, which is automatically built from the 5.x branch.

A new Git tag for this feature has not been published yet; it's currently blocked on true streaming support. https://github.com/weserv/images/blob/36ea05803d81573d996d8c6068247940c48c0490/src/api/CMakeLists.txt#L80-L86

kleisauke commented 3 months ago

Documentation has been updated. https://wsrv.nl/docs/format.html#lossless-compression