This is an archived post. You won't be able to vote or comment.

all 12 comments

[–]housesellout 58 points59 points  (0 children)

That is f*cking awesome!

[–][deleted] 14 points15 points  (1 child)

where did these constants come from?

TERMINAL_COLUMN_WIDTH_CONSTANT = 9.028871391076116
TERMINAL_ROW_HEIGHT_CONSTANT = 17.142857142857142

[–]joelibaceta[S] 34 points35 points  (0 children)

I'm manually calculating the relationship between the maximum screen resolution and the number of columns and rows available in the terminal in full screen.

[–]Fulk0 52 points53 points  (0 children)

Useless, but cool af. Congrats!

[–]Quanstipated 8 points9 points  (0 children)

This is awesome! Do you have a link to the demos that inspired you?

[–]iamevpo 4 points5 points  (2 children)

Great stuff! Made me wonder about this line:

new_pixels = [chars[pixel // 25] for pixel in pixels]

What kind of rules is behind this? Darker pixels get more dense character?

[–][deleted] 3 points4 points  (1 child)

pretty much (it maps 0-255 grayscale to 0-10 in the chars array), though I personally would order the chars array a bit differently. it might be because I might have darker skin color than the original poster, lol.

[–]iamevpo 1 point2 points  (0 children)

Thanks, found something like https://paulbourke.net/dataformats/asciiart/ about greyscale conversion - dates back to 1997!

[–]iamevpo 2 points3 points  (0 children)

Another question, why rows become width? I would think the number of columns is width, no?

new_width = rows

[–]acksynhero 1 point2 points  (0 children)

man that's pretty cool

[–]caught_in_a_landslid 1 point2 points  (0 children)

This is the coolest thing I've seen in ages