Anyway, my game consisted of a slide of images and we vote what's the most appropriate format. When when people got a hang of it, I threw in WebP and SVG. I talk about those last, because they can easily abused: i.e an SVG with an embedded png.
Anyway, my game consisted of a slide of images and we vote what's the most appropriate format. When when people got a hang of it, I threw in WebP and SVG. I talk about those last, because they can easily abused: i.e an SVG with an embedded png.
The SVG was 20MB. The PNG version at huge resolution was 20kB.
PNG is really good when you have a few flat colors. SVG is really bad when you have lots of fine detail.
Well maybe not huge huge. Like 1000px wide so they look nice on retina screens.
The key is that these images were just 2 contiguous color areas. Black and transparent. PNG is really good for that because the compression algorithm works on the basis of contiguous color areas.
What I mean is, if you have a million pixels of the same color (0xDEADBEEF maybe), then PNG will call that 1,000,000 x OxDEADBEEF. So, it scales very nicely for few-color, sparse or "blocky" images.
It’s incompetence to blame rather than file-size, maybe designers or someone in the briefing process that is uninformed that confuses the requirements for everyone else.
Also… I don’t trust Figmas quality with exported SVG. Just type some text, export it and see how it degrades…
Couldn’t find the source of the issue so could only assume the SVG data was being compressed on export.
We decided to only use it to share graphic across the team, in any instance we were working with type we used illustrator.
It's not just size but also decompression time. JPEG is way faster to decode which is also on the critical path towards time-to-display
And they’re correct.
PNGs use lossless compression.
JPEGs use lossy compression. (JPEG XL allows for lossless.)
Can you tell me which university class you took that did?
JPEG, PNG, WebP, JPEG XL and SVG. Even though I am pretty sure JPEG XL will win 95% of times.
You can also use lossless WebP in place of PNG these days.
To implement this you can get nginx to generate the webp from the JPG or PNG. Then you get that cached by your CDN.
If you need to change your compression levels then you can delete the cache on the CDN.
You can use the varies header to see if webp is accepted. If not, serve the original. In this way people can save the hires JPG with a right click.
You can also amp up the compression just for when the data saving flag is set.
The best thing is that you can do all this with hardly any lines of code and the VIPS library to optimise it.