Live data from Hacker News

The smallest 256x256 single-color PNG file, and where you've seen it (2015)

mjt.me.uk

11–20 of 104 posts

Re: The smallest 256x256 single-color PNG file, and where you've seen it (2015)

#11
post #8
post #5

Convert to svg maybe? For OpenStreetMap 136 bytes http://www.w3.org/2000/svg " width="256" height="256" viewBox="0 0 256 256">

The png is only 103 bytes though. Btw your svg can be decreased by changing viewBox to 0 0 1 1, and also by changing the path to a circle (implicitly positioned at 0, 0)

Doesn't the SVG scale better? I sure hope so.

Re: The smallest 256x256 single-color PNG file, and where you've seen it (2015)

#12
post #6
post #5

Convert to svg maybe? For OpenStreetMap 136 bytes http://www.w3.org/2000/svg " width="256" height="256" viewBox="0 0 256 256">

But the PNG provided was 103 bytes :3 Also - pardon my ignorance, this may be a dumb question, is SVG universally supported in browsers these days? I’m not big up on image standards.

Yes, it's everywhere.

Re: The smallest 256x256 single-color PNG file, and where you've seen it (2015)

#13
post #6
post #5

Convert to svg maybe? For OpenStreetMap 136 bytes http://www.w3.org/2000/svg " width="256" height="256" viewBox="0 0 256 256">

But the PNG provided was 103 bytes :3 Also - pardon my ignorance, this may be a dumb question, is SVG universally supported in browsers these days? I’m not big up on image standards.

Yes

https://caniuse.com/?search=svg

Re: The smallest 256x256 single-color PNG file, and where you've seen it (2015)

#14
post #8

Earlier quoted context omitted.

The png is only 103 bytes though. Btw your svg can be decreased by changing viewBox to 0 0 1 1, and also by changing the path to a circle (implicitly positioned at 0, 0)

The SVG could also be served with gzip compression.

  >>> len(''.encode('zip'))
  122
Gzipping doesn't save much.

Re: The smallest 256x256 single-color PNG file, and where you've seen it (2015)

#16

One thing I've wondered about are size savings for DEM tiles. Typically elevation values are encoded in RGB values giving a resolution down to fractions of an inch [1]. This seems like overkill. With an elevation range from 0 - 8848 meters (Mt everest), you can use just 2 bytes and get an accuracy down to .2 meters. That seems plenty for many uses. Does anybody know if there's a PNG16 format where you can reduce the…

I’d suggest jpeg; lossy compression over the full precision data will get you to your target bit rate trivially.

Re: The smallest 256x256 single-color PNG file, and where you've seen it (2015)

#17

One thing I've wondered about are size savings for DEM tiles. Typically elevation values are encoded in RGB values giving a resolution down to fractions of an inch [1]. This seems like overkill. With an elevation range from 0 - 8848 meters (Mt everest), you can use just 2 bytes and get an accuracy down to .2 meters. That seems plenty for many uses. Does anybody know if there's a PNG16 format where you can reduce the…

I’d suggest jpeg; lossy compression over the full precision data will get you to your target bit rate trivially.

People get funny about accuracy in maps. Being able to specify accuracy, even a limited accuracy, is worth a lot. Saving bytes by reducing specified accuracy is in a lot of use-cases better than saving bytes by fuzzing data.

Re: The smallest 256x256 single-color PNG file, and where you've seen it (2015)

#18

One thing I've wondered about are size savings for DEM tiles. Typically elevation values are encoded in RGB values giving a resolution down to fractions of an inch [1]. This seems like overkill. With an elevation range from 0 - 8848 meters (Mt everest), you can use just 2 bytes and get an accuracy down to .2 meters. That seems plenty for many uses. Does anybody know if there's a PNG16 format where you can reduce the…

The PNG format already allows grayscale 16bits / channel images. I regularly use this when rendering out depth maps from blender and ffmpeg seems to handle reading from these PNGs just fine (detecting the gray16 pixel format).

However I don’t know of any DEM tile apis that provide these sorts of PNGs but it sounds like a fun project!

Edit: I found this StackExchange post which shows how to generate 16-bit PNGs with gdal https://gis.stackexchange.com/questions/246934/translating-g...

Re: The smallest 256x256 single-color PNG file, and where you've seen it (2015)

#19
post #11
post #8

Earlier quoted context omitted.

The png is only 103 bytes though. Btw your svg can be decreased by changing viewBox to 0 0 1 1, and also by changing the path to a circle (implicitly positioned at 0, 0)

Doesn't the SVG scale better? I sure hope so.

For a single color? I don't think it really matters. It's all inherently lossless.

Re: The smallest 256x256 single-color PNG file, and where you've seen it (2015)

#20
post #11
post #8

Earlier quoted context omitted.

The png is only 103 bytes though. Btw your svg can be decreased by changing viewBox to 0 0 1 1, and also by changing the path to a circle (implicitly positioned at 0, 0)

Doesn't the SVG scale better? I sure hope so.

For a solid color block it doesn't really matter. For the rest of the map sure, Google Maps in normal mode (instead of classic as in the article) is vector rendering based.
Post reply on HN