3 ms·
There's a real-world application for this sort of things - many raster slippy maps send represent empty ocean with carefully optimised single-colour PNG files [
by michaelt 3y ago
There's a real-world application for this sort of things - many raster slippy maps send represent empty ocean with carefully optimised single-colour PNG files [1]
(of course, vector maps are a different matter)
[1] https://www.mjt.me.uk/posts/smallest-png/ https://www.mjt.me.uk/posts/smallest-png/
- zoky 3y agoI once wrote a PL/pgSQL function to return a 1x1 BMP file given arbitrary R, G, and B values, to display a background color for FileMaker records. Still use it to this day as a matter of fact.
- zamadatix 3y agoI wonder how many of these are actually carefully optimized single-colour PNG files vs... just PNG files. Going into Photopea, creating a 256x256 solid blue image, and hitting save gave me a 137 byte image. That'd be a 2nd place in that list. Doing the same in MS Paint gets 5th, beating out the last 2. What seems more likely to me is someone didn't consider the compression settings problem worth optimizing at all (the last 2) or put some work into making sure the images were generally encoded with decent settings (the first 4). After all, optimising your best case which happens to be one of the very few images that can be cached to be reused across multiple tiles to be a few bytes smaller is probably the least efficient way to spend your "efficiency increasing time". Similarly I wonder if saving a few bytes to encode a 1x1 you have the browser upscale is actually an anti-optimisation in that a few extra bytes transferred might be the faster overall method. Would need benchmarking to tell, but again it'd be benchmarking to test how to make the least problematic performance ever so slightly better.