Sharex: Reconsider: Static WEBP Support

Created on 7 Dec 2020  Â·  2Comments  Â·  Source: ShareX/ShareX

Previous issues: #765, #1529, #3656

Animated WebPs have been supported for quite some time in ShareX. All major browsers support WebP now. Even iOS supports static and animated WebPs now.

In 2016 you said:

There is no official C# wrappers for their C++ libraries or whatever language they used. And some C# wrappers using CLI in background etc. Not to mention both encoder library and wrapper library will increase installer size. So too much trouble, not worth adding.

Is this still the case? Is there any reason not to support static WebPs anymore? It has better lossy compression than JPEG/GIF (it can even support transparency in lossy encoding!), better lossless compression than PNG, and animated WebPs are already supported in ShareX.

Most helpful comment

Preface: I do not consider the below a solution, it's a workaround.

While it's possible to sort of accomplish this using Actions:

png→webp

This is far from ideal and adds extra processing time.

For anyone who wants to emulate my setup, these are my fields:

  • Name: png→webp
  • File path: %MyDocuments%\tools\cwebp.exe — You need to grab libwebp binaries for Windows yourself and put them somewhere that works for you.
  • Arguments: -mt -lossless -alpha_q 100 -alpha_filter best -z 9 -sharp_yuv %input -o %output
  • Arguments: -mt -z 9 %input -o %output
  • Output file name extension: webp
  • Extension filter: png
  • ✅ Hidden window
  • ✅ Delete input file

Note: Don't forget to enable Perform actions in After capture tasks!

With this setup, converting larger screenshots can take quite awhile, so you'll have to be patient if screenshotting, for example, a video game with lots of complex things on-screen.

Also...the Arguments field could probably be refined, I just chose options that will preserve transparency, compress said transparency, compress the output image (losslessly) as much as possible, and convert colors as accurately as possible. I've simplified the Arguments field. I think that is fine. -sharp_yuv was actually having a negative effect sometimes.

All 2 comments

Preface: I do not consider the below a solution, it's a workaround.

While it's possible to sort of accomplish this using Actions:

png→webp

This is far from ideal and adds extra processing time.

For anyone who wants to emulate my setup, these are my fields:

  • Name: png→webp
  • File path: %MyDocuments%\tools\cwebp.exe — You need to grab libwebp binaries for Windows yourself and put them somewhere that works for you.
  • Arguments: -mt -lossless -alpha_q 100 -alpha_filter best -z 9 -sharp_yuv %input -o %output
  • Arguments: -mt -z 9 %input -o %output
  • Output file name extension: webp
  • Extension filter: png
  • ✅ Hidden window
  • ✅ Delete input file

Note: Don't forget to enable Perform actions in After capture tasks!

With this setup, converting larger screenshots can take quite awhile, so you'll have to be patient if screenshotting, for example, a video game with lots of complex things on-screen.

Also...the Arguments field could probably be refined, I just chose options that will preserve transparency, compress said transparency, compress the output image (losslessly) as much as possible, and convert colors as accurately as possible. I've simplified the Arguments field. I think that is fine. -sharp_yuv was actually having a negative effect sometimes.

nice solution option
works like a charm
thx blood

Was this page helpful?
0 / 5 - 0 ratings

Related issues

monirulalom picture monirulalom  Â·  3Comments

sparxz picture sparxz  Â·  4Comments

BristolITDave picture BristolITDave  Â·  3Comments

skygate2012 picture skygate2012  Â·  3Comments

hikapoo picture hikapoo  Â·  4Comments