Discussion summary

A user claims to create a recognizable world map in under 500 bytes, sparking discussions on feasibility and purpose.

What the discussion says

  • Some believe it's possible to create a recognizable map within 500 bytes.
  • Others question the point of such micro-optimization or its recognizability.
  • Participants discuss previous attempts and the significance of such challenges.
Here's a map of the entire world in 1 byte.
27183
I did it 10 years ago by myself in 1013 bytes :)
iweczek

Join the discussion

Write your take first — we'll ask for email only when you're ready to publish.

  • Hacker News
  • Its a fun challenge.

    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.

  • great job, looks like you got it down to 786 bytes of html and under 400 for the map data. I like your approach.
  • With a whooping 500 bytes it should have sound, animation and disco lights[1][2].

    [1]: https://www.youtube.com/watch?v=_RtfXZQihes

    [2]: https://www.pouet.net/prod.php?which=105717

  • 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.
  • 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.
  • Here's a map in one bit, where 0 is water and 1 is land: 0
  • Any decent compressor will take care of this - and much more.
  • I like that yours is 45 rows of asterisks.

    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/

  • I feel like this challenge would be a lot more interesting if the size of complete code needed to output the map were counted.
    by 1e1a
  • 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.
  • Why is there a lake in Africa near Congo/Gabon istead of one near Uganda?

    Also, can this be done with png? Most consecutive lines are very similar, so I'd expect the algebraic pass to be very useful.

  • > Why is there a lake in Africa near Congo/Gabon istead of one near Uganda?

    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).

  • 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.
  • Well, here's what Fable came up with in 499 bytes of R in about half an hour: https://pastebin.com/sBsiGD9t, result: https://imgur.com/a/W3eDdIC. Probably with sitting down and tweaking you could do even better, but I think this is a decent first start.
  • 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.

  • that sounds pretty related to Kolgomorov complexity, which is uncomputable in general. https://en.wikipedia.org/wiki/Kolmogorov_complexity

    I too would be interested in approximations or heuristics if anyone has any

  • A perfect implementation would be a Kolmogorov oracle. https://en.wikipedia.org/wiki/Kolmogorov_complexity#Halting_... suggests this is equivalent to a halting oracle. So, it depends what you mean by "good".
  • 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.

  • 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
      )
  • u don't need the first .then: https://github.com/piwodlaiwo/smallest-world-map/pull/1

    mine is shorter

  • I know this doesn't meet the spirit of the challenge, but...

              _,--',   _._.--._____
       .--.--';_'-.', ";_      _.,-'
      .'--'.  _.'    {`'-;_ .-.>.'
            '-:_      )  / `' '=.
              ) >     {_/,     /~)
      snd     |/               `^ .'
  • 180?
  • One could probably map this in JavaScript in 3D on a rotating sphere and it'd be a "recognizable world map" of sorts.
  • it said recognizable, and I recognize this :)