Url2Ascii (Color)

Written 11:18 am 3/29/2013 Modifed 04:15 pm 4/4/2013
Kim Jong Un approves.

I made a utility a while ago to convert images to ascii, for covert reddit browsing ability. I recently added color to it.

The script gives you a number of customizations- you can change the x / y ratio for your glyphs, which characters get printed out, and at what brightness, and you can calibrate the colors to match your terminal. This is specifically for 8 color terminals

The inner workings have it resampling the image to your indicated terminal size. It then converts each box into its HSV values. It tries to best match the HSV by changing the glyph, the foreground color, and the background color. You can check the code if you're interested

View on Github

Run this in the shell:

curl -Ls https://gist.github.com/oranj/5271841/raw/url2ascii.php | php -- http://oranj.io/uploads/misc/url2ascii/flower_2.jpg

Or if you want to select your own image (This script is mac only):

file=`osascript -e 'tell app (path to frontmost application as Unicode text) to set new_file to POSIX path of (choose file with prompt "Select A File" of type {"PNG", "JPG", "JPEG"})'  2> /dev/null`; curl -Ls https://gist.github.com/oranj/5271841/raw/url2ascii.php | php -- "$file"

input output

Using a screen color grabber (like DigitalColor Meter, should come on macs), you can figure out what your terminal's colors are using the calibration function, calling

url2ascii calibrate

calibration

Posted by Anonymous on November 17th, 2017, 3:47 pm Reply

??????? ?????????. ??????????? ????????-??????????? ?????? ??? ??????????? ? ???????? ? ????? ?????! ???? ????????? ??? ??? ??????????? ? ????????? ?????????? ? ????????. ?????? ? ICQ 656310373

Posted by Anonymous on November 8th, 2017, 7:00 am Reply

Wonderful write ups, Thanks. canadianpharmaciesbnt.com costco pharmacy pricing

Posted by Anonymous on September 23rd, 2017, 9:54 am Reply

???????????????????????? ????? ??? ??????, ??????? ?????, ????? ??? ???

Posted by Anonymous on September 11th, 2017, 8:33 am Reply

???????????????????????? ??????????? ?????, ??????? ?????, ????? ??? ???

Posted by I fixed that issue. Another thing. Is there a way to implement prennetivg large downloads from timing out? I have multiple 400+ MB files and they are all timing out. If I do direct link they always complete. Any help would be appreciated. Def willin on February 21st, 2016, 8:09 am Reply

I fixed that issue. Another thing. Is there a way to implement prennetivg large downloads from timing out? I have multiple 400+ MB files and they are all timing out. If I do direct link they always complete. Any help would be appreciated. Def willing to donate if I can get this last issue resolved