Obsolete for compatibility reason; Change costume encoding, PNG > WEBP

Caution: a very large project, may cause trouble to your browser.

Snap uses "image/png" as the default format for storing images in the project. The new Web format, "webp" has a much better compression ratio and acceptable compatibility. This change should be fully transparent for users.

Edit: The compatibility table makes this proposal obsolete, as it does not work in Safari. As a loose compression, "image/jpeg" has much better compatibility.

Summary

To get some estimation, I created a project with ~70 large costumes from an image hosting site. The nominal project size is ~16MB and cannot be saved to the cloud. But I instructed Snap! to store costumes as "image/webp". The project size is now 2.6MB and can be saved to the cloud or exported.

But did you make sure the compression was lossless?

Webp is a great format, as it can store lossless images better than png, but it can also store lossy images.

I agree with this, especially when it comes to working on and saving a really big project.

I thought WebP lossless file sizes averaged about 75% of PNG

Are those project special images that compress to WebP much better than PNG?

Good point.
I should calc the hash to verify.


Random rather big and detailed images.
Maybe lossy compression is applied by default.

My idea is that Snap! should use GZIP to compress the media into way smaller sizes. That way, both images and sounds are smaller without having to change any file formats? :slight_smile:

Dedicated encoding/compression schemes do a much better job for their intended purpose, i.e., PNG/WEBP/JPG for images, PCM/Vorbis for sounds, than the generic ones (GZIP).

My bad. Files were compressed with the default 0.92 quality.
For q = 1, the project size is 11 MB

WEBP lossless rant

I'm still not fully confident if that (q=1) makes lossless webp.
But "image/webp.ll" does not work for me as intended
Issue 1302423004: Support lossy and lossless <canvas>.toDataURL for webp - Code Review

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.