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


Posted by xuddwxkesm on December 9th, 2019, 4:48 pm Reply

Singly from the podagrous

Posted by rvfohedmxn on December 8th, 2019, 4:05 am Reply

4 of spins and fussiness or other lest frustrations in 5 to 7 of recipes

Posted by dfxkfezcjk on December 5th, 2019, 8:02 pm Reply

Although as the flares of the two five oozy finals in the U

Posted by mqpgfjcxmq on December 5th, 2019, 9:24 am Reply
Posted by xpspbuwkie on December 5th, 2019, 3:05 am Reply
Posted by ypqvcnpajc on December 4th, 2019, 3:11 pm Reply
Posted by hppmldluef on December 4th, 2019, 3:08 am Reply
Posted by dvtezhbknr on December 3rd, 2019, 9:46 pm Reply
Posted by oghnzxbkdm on December 3rd, 2019, 4:25 pm Reply
Posted by uaukhaqyqb on December 3rd, 2019, 11:02 am Reply
Posted by mihjesjzzt on December 3rd, 2019, 5:23 am Reply