flameshot icon indicating copy to clipboard operation
flameshot copied to clipboard

Adds WebP Quality Config

Open PoneyClairDeLune opened this issue 1 year ago • 3 comments

Like #3285, this PR aims at introducing a quality config into Flameshot, allowing users to customize the quality of the WebP image emitted by Flameshot.

However during the testing of this PR, I've noticed a few problems with the output emitted from the Qt5 ImageFormat plugin.

  • The resulting files produced by Flameshot are inferior compared to ones emitted by cwebp with the exact same quality value.
  • The Qt5 ImageFormat plugin doesn't allow saving as lossless WebP, which is a far superior lossless image format than PNG, allowing on average 27% size reduction.
  • Said plugin also doesn't allow customizing effort value used to optimize the resulting image.

So perhaps, for the easier route, there should be a config option, allowing Flameshot to automatically execute a command to optimize the final image from PNG. Or maybe integrate libwebp or libvips directly?

PoneyClairDeLune avatar Jul 19 '24 06:07 PoneyClairDeLune

@PoneyClairDeLune Thanks for the PR.

@jack9603301 & @FelixJochems What is your opinion about this question?

mmahmoudian avatar Jul 19 '24 09:07 mmahmoudian

It looks like Qt6 might support lossless webp: https://doc.qt.io/qt-6/qtimageformats-attribution-libwebp.html I wonder how that compares to something like libwebp

If Qt6 fixes the issue, I would be inclined to merge this as is, and then when we update to Qt6 we get an additional benefit.

borgmanJeremy avatar May 12 '25 21:05 borgmanJeremy

Since we are on Qt6 now, it would be good to see if this is still needed.

borgmanJeremy avatar Jun 13 '25 22:06 borgmanJeremy