Share your projects


spud42

Very Active Member
Joined
Aug 22, 2009
Messages
849
Age
61
Location
Brisbane,Australia.
Lay down carpet then. Or is your mom strictly against carpet?
no idea my mom lives on the other side of Brisbane... 50 Km away..lol
The missus falls asleep with the remote on her lap. when she gets up to go to bed the remote sometimes goes flying and misses the rug...
 

FBnil

They'll own everything and be miserable.
Joined
Dec 14, 2012
Messages
5,074
Location
Yurp
I've been pondering about using Unicode Character 'LOWER HALF BLOCK' to double the pixel resolution on a terminal, such that the background and foreground colors of that block are "two pixels" in one.
So I searched the web on how to get pixel information from ImageMagick, which I then feed to a perl script to join together (so two pixel lines make one ascii line).
I then tried to convert the truetype colors to RGB256, and the result was rather bland when using real pictures, but okayish with drawings. Then I added file compression by checking the previous pixel, and if it's the same color, it skips printing the ansi escape codes.
Improvements can be made by using quadrants to curve-fit better, but that would require to antialias with the image before compressing it down with ImageMagick. That would fix the jaggedness of the chin in the sample image. But within that block, we can still only use 2 colors. (a limitation familiar to C64 graphic artists)

$ ./image2ascii.pl ~/Picture/socialmedia/12399.jpg 12399.ascii 0 1

Screenshot_miku.jpeg

ASCII_DBPlogo.jpg

Edit: Added the code to GitHub:
 
Last edited:

FBnil

They'll own everything and be miserable.
Joined
Dec 14, 2012
Messages
5,074
Location
Yurp
wow that's pretty amazing. except your perl bites ;) you should submit it to TPJ.
True that (that was 2 hours into the project). I was too exited and posted too soon. I've uploaded a stable version to Github. And Of course, the == are now eq (thanks to use warnings pragma). It now has proper getopts and the compression algorithm (to skip ANSI escape codes when not needed) has been fixed.

 
Top