3 ms·
> Why not find minimally-perceptible pixel changes to the image that allow it to compress better as PNG? I would bet a whole pizza, anchovies included, that yo
by scrollaway 6y ago
> Why not find minimally-perceptible pixel changes to the image that allow it to compress better as PNG?
I would bet a whole pizza, anchovies included, that you'd be the first one to fire an engineer who wasted his time pixel-perfecting a random PNG on your homepage under the guise of performance, when this is actually an alternative.
The JPG-in-SVG is a beautiful hack to work around Apple's former refusal to support WebP. You can just use WebP if you are okay giving older iOS/macOS users the finger. This isn't web dev being "hacky", it's Apple being shitty.
Hasn't HN always celebrated such hacks?
- wizzwizz4 6y agoJust write a program to do the pixel-perfecting.
- scrollaway 6y agoNow that's a thought. (OptiPNG exists, btw: http://optipng.sourceforge.net/ http://optipng.sourceforge.net/) The fact is, if you know how JPG and PNG work, you'll know that a colorful and busy image like the one linked in the article, with lots of varying alpha colors and values for anti-aliasing, is basically impossible to compress anywhere close to a JPG. There are more lossy ways to compress PNG which aren't done automatically anywhere to my knowledge, such as reducing the amount of colors to fit a smaller color space. What you can also do is turn the image into contiguous chunks so that they are in a pattern that is more compressib… wait, we're just reinventing JPG aren't we.