ripe-tech/ripe-sdk

"lossless" image format is not lossless

Closed this issue ยท 5 comments

Description

When using lossless as an image format, it's expected to be served images which are lossless, but that's not the case for webp with the default options.

Example:

Woof, Woof!

Thank you for submitting the ""lossless" image format is not lossless" issue ๐Ÿ˜Ž.

Please do not forget to review our internal guidelines:

  • Describe the problem in the best possible way
  • Include at least the Description section, but considered adding other sections
  • Avoid suggesting immediate solutions, think deeply about the problem
  • Engage in the Triage process being as responsive as possible
  • Understand and accept the possibly large amount of execution time
  • Avoid immediate reallocation of the issue, let triage do their job

Engaging in the development process in the best possible way helps it being efficient and fast.

Your friend,
Tobias (Platforme's mascot)

Tobias Bot

Let's not be strict here "Lossless == Almost lossless" ๐Ÿ˜†
Now seriously nice catch

Let's make default webp options lossless and measure the impact in image size, then discuss on this one

After a deeper investigation I've come to realize that this could not be fixed by increasing the quality = 100 (currently at 95) implemented here - the quality degradation from changing 95 -> 100 looked visually imperceptible to my eyes.

The buggy "blur" effect, mostly evident on the initials "MARTA" is being caused by the python imaging library most specifically the PIL.WebPImagePlugin which we use when saving the image composition at image.save for webp format. This WebPImagePlugin has lossless at false by default and that was the cause of this blur effect.

Below are the image compositions

- -
current webp at 90% quality = 247.27 kb
lossless webp at 95% quality = 913.13 kb imagem
lossless webp at 100% quality = 913.6 kb imagem
png = 1.27 MB imagem

I'm creating a PR for the 2nd option lossless webp at 95% quality = 913.13 kb