Your .webp can be smaller, just use .png beforehand

dev optimization image formats

Investigating why all .webp files are not equal.

Published on . Last updated on .

This project isn't done yet (or the writeup isn't done)! Updates are to come!

What question am I trying to answer?

For starters, go visit the associated /experiment page.

Why does converting a .png file to a .webp obtain a smaller size than the same image in .jpg format being converted in .webp?

Some stats (without the images)

Here is the same table from the /experiment page but without the images. (Styling will be funky because I usually use tables for image collages in markdown, so I am inlining CSS in the .md file)

Image titleJPEG/JPGPNGJPEG/JPG -> WEBPPNG -> WEBP
Our lovely neighbor - Boris Groh336 KB1.5 MB225 KB94 KB
bullpup116 KB598 KB100 KB39 KB
James Webb telescope image5 MB29.5 MB3.2 MB577 KB

As you can see, converting an image from a .png to a .webp instead of .jpg -> .webp, will greatly decrease the output image size, with no change (at least visible) in quality.

Why is that?

I have no idea, but I want to find out.

If you see this page and have ideas or knowledge on the subject, please DM me on X/Twitter.

or View Other Projects

true