Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

can i get that in ascii please?


used qrencode and img2txt to get ascii.


I followed your lead, but I didn't like the way the img2txt looked. I just wanted black and white.

Then I saw it was unnecessary, qrencode provides ANSI support.

  echo foobar |qrencode -tANSI -o-     #grey, blech
So I threw some sed at it:

  echo foobar |qrencode -tANSI -o- | sed -e "s/\[47m/\[0\;5\;37\;47m/g" -e "s/\[40m/\[0\;34\;40m/g"
But then I looked again, and qrencode provides this to you too:

  echo foobar |qrencode -tANSI256 -o-  # pretty, yay
You can double the output size with:

  echo foobar |qrencode -tANSI256 -o-|sed -e "s/ /  /g;p"
Very pleasing! Might actually use qr codes now.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: