Vrc2webp.exe: A tool for converting screenshots from unoptimized PNGs to efficient WebPs

Hello there! A few weeks ago, I started organizing my screenshots and realized that it take up a lot of space. So I decided to research what I could do about it.

After a long googling of the formats that are relevant today, experiments with “PNG optimization”, various JPEG quality settings, etc. I have come to the conclusion that WebP is the best format for storing images today. It’s not that new anymore, so a lot of programs support it. It combines the best features of PNG and JPEG: supports transparency, lossy and lossless encoding, and most cool: it takes about 20%…30% less space than PNGs with compression 9!

Something else interesting also came up: Most of my 4K screenshots are larger than 8MiB, but after recoding them to WebP, they are almost all smaller than 8MiB. What does it mean? Such screenshots can be easily thrown into the Discord without Nitro and without server Boost!

This news inspired me so much that I decided to make a tool that will not only recode my entire screenshot library to WebP, but will also do it with best quality and maximum compression, and will be able to do it automatically in the background.

You can learn more about features and download my tool here:

At this stage, I think, the program has been more or less tested, all the main functions have been implemented, so it is quite ready for everyday use.
I reduced my library from about 14GiB to 8.3GiB: -40% (!!!)

6 Likes

I tried your tool, very cool idea!

I’m encountering an issue where it’s using the wrong drive letter, hope the log’s helpful. (My ‘Pictures’ folder on C: goes to a folder on G:, looks like it got confused by that)

PS C:\Users\anableps> cd G:\Users\Fax\Pictures\VRChat
PS G:\Users\Fax\Pictures\VRChat> .\vrc2webp.exe -r
[2022-10-08 05:40:22,093][INFO] Logging initialized. APP_DEBUG=False
[2022-10-08 05:40:22,133][INFO] cwebp.exe test OK: 1.2.4
[2022-10-08 05:40:22,165][INFO] webpinfo.exe test OK: WebP Decoder version: 1.2.4
[2022-10-08 05:40:22,166][INFO] Started recoding loop. Awaiting for files to recode...
[2022-10-08 05:40:22,166][INFO] Preparing file system observer...
[2022-10-08 05:40:22,167][INFO] Scanning items in 2 watch paths.
[2022-10-08 05:40:22,167][WARNING] Failed to resolve C:\Users\anableps\Pictures\VRChat: builtins.FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\Users\\anableps\\Pictures\\VRChat'

Yea if you using non-default folders, you should configure correct paths in the config.
It does not takes your current working dirrectory into account.
You can export default config:
C:\Path\To\Your\vrc2webp.exe -e -c C:\Path\To\Your\config.yaml
edit watch-paths: section in the config
and then run tool with config: C:\Path\To\Your\vrc2webp.exe -r -c C:\Path\To\Your\config.yaml
I’ll probably change to cmd arguments instead of config later, as it more flexible and easier to setup.

1 Like

That was rather easy. Thank you!

Seems like it’s doing a good job at reducing size. The progress started off with a negative number though, for some reason :sweat_smile: Must have been files that don’t benefit from webp?

[2022-10-08 22:42:22,950][INFO] Recoded 6 files from 1.28MiB to 1.79MiB. Reduced size by -517.40KiB (-39.4%). 2160 files pending recoding. 12 files recoding right now.
[2022-10-08 22:42:32,967][INFO] Recoded 15 files from 8.96MiB to 8.69MiB. Reduced size by 274.87KiB (3.0%). 2151 files pending recoding. 12 files recoding right now.
[2022-10-08 22:42:42,966][INFO] Recoded 18 files from 11.27MiB to 9.63MiB. Reduced size by 1.64MiB (14.5%). 2148 files pending recoding. 12 files recoding right now.
[2022-10-08 22:42:52,975][INFO] Recoded 19 files from 12.36MiB to 10.32MiB. Reduced size by 2.04MiB (16.5%). 2147 files pending recoding. 12 files recoding right now.
[2022-10-08 22:43:02,982][INFO] Recoded 21 files from 16.77MiB to 12.96MiB. Reduced size by 3.81MiB (22.7%). 2145 files pending recoding. 12 files recoding right now.
[2022-10-08 22:43:12,983][INFO] Recoded 26 files from 28.60MiB to 20.45MiB. Reduced size by 8.15MiB (28.5%). 2140 files pending recoding. 12 files recoding right now.
[2022-10-08 22:43:22,982][INFO] Recoded 32 files from 46.83MiB to 31.14MiB. Reduced size by 15.69MiB (33.5%). 2134 files pending recoding. 12 files recoding right now.
[2022-10-08 22:43:32,987][INFO] Recoded 33 files from 47.86MiB to 31.66MiB. Reduced size by 16.21MiB (33.9%). 2133 files pending recoding. 12 files recoding right now.
[2022-10-08 22:43:43,009][INFO] Recoded 37 files from 55.10MiB to 36.15MiB. Reduced size by 18.95MiB (34.4%). 2129 files pending recoding. 12 files recoding right now.
[2022-10-08 22:43:53,011][INFO] Recoded 42 files from 63.37MiB to 41.21MiB. Reduced size by 22.16MiB (35.0%). 2124 files pending recoding. 12 files recoding right now.
[2022-10-08 22:44:03,018][INFO] Recoded 44 files from 69.01MiB to 44.58MiB. Reduced size by 24.43MiB (35.4%). 2122 files pending recoding. 12 files recoding right now.
[2022-10-08 22:44:13,030][INFO] Recoded 47 files from 75.62MiB to 48.44MiB. Reduced size by 27.17MiB (35.9%). 2119 files pending recoding. 12 files recoding right now.
[2022-10-08 22:44:23,022][INFO] Recoded 53 files from 85.53MiB to 54.74MiB. Reduced size by 30.79MiB (36.0%). 2113 files pending recoding. 12 files recoding right now.
[2022-10-08 22:44:33,035][INFO] Recoded 57 files from 92.91MiB to 59.17MiB. Reduced size by 33.74MiB (36.3%). 2109 files pending recoding. 12 files recoding right now.

Yes, there is a chance small PNGs will be larger after recoding. Also same issue with JPEGs saved with low quality. I did not made check yet for resulting file size .

Hello again @kawashirov !! Good to see you!

Thank you for this tool! The lossless PNGs we save for big images are HUGE. I have to transfer them off my SSD regularly if I take many photos.

Maybe we’ll implement WebP natively, but PNG remains far more ubiquitous.

1 Like

My computer won’t even open WebPs or recognize them as anything and I’m on an updated Windows 10 PC.

I’ve never heard of this file format, but this is amazing! Might try the tool, though I would still prefer jpeg to compress the photos since I want to view them on my phone.

You can try XnView MP. It supports almost every image furmat. But default UI and controls a bit confusing, need to play with preferences.

1 Like

Android has supported WebP for a long time.

Just checked on my pretty cheap Android - it’s recognized in every app.

Not sure about iOS, but quick google says Apple has support for WebP from iOS 14.0+ and macOS 11.0+

You guys can try save this WebP image as sample to local storage to check is it working for you: VRChat_2019-07-15_21-45-41.725_1920x1080.webp - Google Drive

omg it does work on my Android phone!