Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: I wrote a rust program to translate images into textual line art (github.com/lf94)
70 points by fallat on Feb 1, 2021 | hide | past | favorite | 9 comments



Wow! Very nice too!

Is the main difference the size of the masks? Yours appear to be 8x4, and png2linetext uses 3x3. It would make sense that the output is higher resolution. Maybe we can do better with larger mask sizes? :D

Of course derasterizer also gets more resolution through color, whereas png2linetext uses just black and white.

Edit: Ah, I guess the magic here is `adjudicate`, which selects the closest match. Mine is very dumb in this regard, or I guess is "pre-matched" by me.

Edit2: I'm going to see what happens with a larger mask!

Edit3: Definitely getting some nicer lines but I lose all the details. I think a marching cubes-like algorithm could work really well here.

Edit4: Based on your project I inferred that adding more matches seems to add more resolution and yeah, outputs are looking even nicer now. I updated the repo! I also used shapes which are less sharp rather than "perfect match".


This is really good. Nice work. Was looking for one of these and was very frustrated with what I found at the time.

Was trying to put project logo into a cli Easter egg.


Something similar in Python: https://github.com/daleroberts/tv


Have you tried exporting it so the text image opens in the browser? I can imagine this being a really cool way to load low-res images in the browser in an extremely lightweight fashion :)


I hate it when ascii art is placed in images. Sad that the README goes that route, I was actually viewing the page with Lynx and didn't care much for chrome deficiencies...

BTW, ImageMagick can export Unicode Braille files. Something like convert foo.png foo.ubrl will give you a dotified textual representation.


Especially when the comparison images are all in different fonts and scale factors!


Err? It's all the same scale, they are set to 80 character widths...At least the ones I could set...


Yours and topster's seem to be stretched greatly in the vertical direction, which makes them higher resolution. Glassgiant's is stretched a little too.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: