Live data from Hacker News

ASCII characters are not pixels: a deep dive into ASCII rendering

alexharri.com

31–40 of 158 posts

Re: ASCII characters are not pixels: a deep dive into ASCII rendering

#31

Nice! Now add colors and we can finally play Doom on the command line. More seriously, using colors (not trivial probably, as it adds another dimension), and some select Unicode characters, this could produce really fancy renderings in consoles!

At least six dimensions, right? For each character, color of background, color of foreground, and each color has at least three components. And choosing how the components are represented isn’t trivial either - RGB probably isn’t a good choice. YCoCg?

Re: ASCII characters are not pixels: a deep dive into ASCII rendering

#32
Great article!

I think there's a small problem with intermediate values in this code snippet:

  const maxValue = Math.max(...samplingVector)

  samplingVector = samplingVector.map((value) => {
    value = x / maxValue; // Normalize
    value = Math.pow(x, exponent);
    value = x * maxValue; // Denormalize
    return value;
  })
Replace x by value.

Re: ASCII characters are not pixels: a deep dive into ASCII rendering

#33

There is already a C library that does realtime ascii rendering using décision trees: GitHub: https://github.com/symisc/ascii_art/blob/master/README.md Docs: https://pixlab.io/art

The OP's ASCII art edges look way better than this

Re: ASCII characters are not pixels: a deep dive into ASCII rendering

#35
post #18

Great breakdown and visuals. Most ASCII filters do not account for glyph shape. It reminds me of how chafa uses an 8x8 bitmap for each glyph: https://github.com/hpjansson/chafa/blob/master/chafa/interna... There's a lot of nitty gritty concerns I haven't dug into: how to make it fast, how to handle colorspaces, or like the author mentions, how to exaggerate contrast for certain scenes. But I think 99% of the time, it…

my favorite ascii glyphs are the classic IBM Code Page 437: https://int10h.org/oldschool-pc-fonts/fontlist/

and damn that article is so cool, what a rabbithole.

Re: ASCII characters are not pixels: a deep dive into ASCII rendering

#37
Very cool effect!

> It may seem odd or arbitrary to use circles instead of just splitting the cell into two rectangles, but using circles will give us more flexibility later on.

I still don’t really understand why the inner part of the rectangle can’t just be split in a 2x3 grid. Did I miss the explanation?

Re: ASCII characters are not pixels: a deep dive into ASCII rendering

#38

Nice! Now add colors and we can finally play Doom on the command line. More seriously, using colors (not trivial probably, as it adds another dimension), and some select Unicode characters, this could produce really fancy renderings in consoles!

"finally"? We were playing Quake II in AAlib in 2006. https://www.jfedor.org/aaquake2/

Re: ASCII characters are not pixels: a deep dive into ASCII rendering

#39

Very cool effect! > It may seem odd or arbitrary to use circles instead of just splitting the cell into two rectangles, but using circles will give us more flexibility later on. I still don’t really understand why the inner part of the rectangle can’t just be split in a 2x3 grid. Did I miss the explanation?

It's because circles allow for a stagger and overlap as shown later on. It's not really possible to get the same effect from squares.

Re: ASCII characters are not pixels: a deep dive into ASCII rendering

#40
> I don’t believe I’ve ever seen shape utilized in generated ASCII art, and I think that’s because it’s not really obvious how to consider shape when building an ASCII renderer.

Not to take away from this truly amazing write-up (wow), but there's at least one generator that uses shape:

https://meatfighter.com/ascii-silhouettify/

See particularly the image right above where it says "Note how the algorithm selects the largest characters that fit within the outlines of each colored region."

There's also a description at the bottom of how its algorithm works, if anyone wants to compare.

Post reply on HN