Is there a good known algorithm which performs general purpose compression where the target is a given turing complete instruction set? Rather than relying on a fixed general purpose decoder and the associated compressed data.
I’m asking here instead of asking an LLM because that’s what humans used to do and it was pleasant.
Presumably you could precompute some parametric function (probably a Fourier sum) which draws a reasonably close map of the world, and get that into 500 bytes with a math-focused programming environment (R, Julia, etc.)? I might try throwing Fable at this and seeing what I can get.
Since the map just has two states - land or water - I wonder if there's a way to represent the same information more efficiently bits rather than bytes.
I didn't know you could do this with fetch() and a data: URI:
fetch('data:;base64,1ZpLsgIxCEXnrM...==').then(
r => r.body.pipeThrough(new DecompressionStream('deflate-raw'))
).then(
s => new Response(s).text()
).then(
t => b.innerHTML = '<pre style=font-size:.65vw>' + t
)
Going from "SVG/Canvas is wasteful" to a tile based approach is a giant leap. Wouldn't AI suggest delta encoding of polyline coordinates and discretization of deltas as small, maybe just 2-4 bit integers? Storing the X and Y delta vectors separately, rather than interleaved, could lead to a further increase to the compression ratio.
What was asked of Claude? The article is very sparse on this.
32x32 4bpp 16-color icon is 512 bytes. There definitely were programs that had a recognisable world map for an icon in those days, so the answer is yes.
Makes me think a project-and-rasterize pipeline, sampling a simplified world water boundary map under a variety of projection parameters should give you a range of bitmaps, and then it is up to whoever to decide if the detail lost in all of this renders it incompatible with the world as they know it.
The site below takes detailed map files and removes significant detail for practical purposes:
Both are interesting, my html file is 846 bytes and the actual map data pulled in is 445 bytes but a comment on my blog someone came down to 786 bytes and it looks like under 400 bytes of data for the map.
Representation for this I came up with: Allocate one magic number for "start line with space" another for "start line with asterisk" then any other number means this many of the current character and then swap character.
Then it's a matter of picking a suitable way to encode numbers into bits.
I came up with groups of four bits. If the high bit is not set that is the number, if it is set then read an additional group of four bits, and interpret as a biased 7 bit number. This came out to 400 bytes not including decompressor.
Yes. Here's a map of the entire world in 1 byte. Both hemispheres. The northern hemisphere is depicted above, the southern hemisphere is depicted below:
I used https://squoosh.app to make a pretty good one. Mostly just a resize and then OxiPNG for compression. Managed a 124x62 black/white image. OP has a resolution of 195x53, so I had very similar, but slightly worse i think? mostly a different aspect ratio + map projection i think.
playing with Squoosh.app is very fun, and you can very easily see how the jump from 500b to 1-2kb turns a map from "awful" to "very good" with the right settings.
35 comments
[ 3.5 ms ] story [ 77.1 ms ] threadAlso, can this be done with png? Most consecutive lines are very similar, so I'd expect the algebraic pass to be very useful.
Africa and Europe are connected through Spain.
There's no Suez channel.
There are plenty of approximation: it's the whole point of the thing... You only get 1013 bytes (or, well, 500 bytes in the question asked).
I’m asking here instead of asking an LLM because that’s what humans used to do and it was pleasant.
mine is shorter
What was asked of Claude? The article is very sparse on this.
Makes me think a project-and-rasterize pipeline, sampling a simplified world water boundary map under a variety of projection parameters should give you a range of bitmaps, and then it is up to whoever to decide if the detail lost in all of this renders it incompatible with the world as they know it.
The site below takes detailed map files and removes significant detail for practical purposes:
https://mapshaper.org/
Then it's a matter of picking a suitable way to encode numbers into bits.
I came up with groups of four bits. If the high bit is not set that is the number, if it is set then read an additional group of four bits, and interpret as a biased 7 bit number. This came out to 400 bytes not including decompressor.
https://www.compart.com/en/unicode/U+1F5FA
https://asciiart.website/artist.php?artist_id=121
https://asciiart.website/preservation/poster.php?person_id=1...
[1]: https://www.youtube.com/watch?v=_RtfXZQihes
[2]: https://www.pouet.net/prod.php?which=105717
I used https://squoosh.app to make a pretty good one. Mostly just a resize and then OxiPNG for compression. Managed a 124x62 black/white image. OP has a resolution of 195x53, so I had very similar, but slightly worse i think? mostly a different aspect ratio + map projection i think.
playing with Squoosh.app is very fun, and you can very easily see how the jump from 500b to 1-2kb turns a map from "awful" to "very good" with the right settings.