ASCII - Image Effects

It isn't just for text messaging, anymore

Converting an image to ASCII text seems to be a rite of photo-manipulation passage.
So, here's my effort.

Psychodelic Sixties - Brett in the Bay
In black and white... or, um, er, rather...


All images from my
front page
just in case you want to check out the originals.


A Walk Thru?
Maybe we should call it a run through.

Ready! Set! Go!

As an advanced effect,
one might want the text to mean something.
I only used ' ', '+', and '@',
as a proof of concept.

Image as ASCII - Brett as a Youngster at Work
This is
Image as ASCII - Brett as an even younger Youngster doing Writing Research
Me!!!
Image as ASCII - Brett slightly older at summer camp, making my parents proud
as a
Image as ASCII - Brett not really a youngster anymore, more like a young punk, setting sail for adventure
Ladd.


Same concept, higher resolution.
Above, picture input size equals output.
Here, output is about 3x times as large.
Next up, an image so large (10,000px +)
the characters all but disappear...

or not because that made my browser crash,
so only 5x at +/- 2000px.

Image as ASCII - Brett as a Youngster at Work
Dag, nabbit!
Image as ASCII - Brett as an even younger Youngster doing Writing Research
But I was
Image as ASCII - Brett slightly older at summer camp, making my parents proud
a cute
Image as ASCII - Brett not really a youngster anymore, more like a young punk, setting sail for adventure
thing.


There are hard ways to do this.
And there are easy ways.

OK. Fine.
I'll tell you the easy way:
image to text based on grayscale intensity
string to file
text file to image using irfanview.

Irfanview!
Know it!
Love it!
Learn it!

As a batch process from inside Python,
I find Irfanview to be convenient for many image processing tasks.

Image as ASCII - Brett as a Youngster at Work
Resolution
Image as ASCII - Brett as an even younger Youngster doing Writing Research
so high,
Image as ASCII - Brett slightly older at summer camp, making my parents proud
the ' ','+',"@'
Image as ASCII - Brett not really a youngster anymore, more like a young punk, setting sail for adventure
come to life.


And then I colourized the pictures.
Details, I won't bore you with...

Psychedelic Sixties - Brett in the Bay
Psychedelic, Man.

And the colours separated and danced in the dark...

In grayscale, black=0, white=1, so:
No red in the face.
No blue in the logo.
Yeah, that looks about right.

Or not, seriously, it hurts my head to try and figure it out.

Image as Colour ASCII - Brett as a Youngster at Work
Red!
Image as Colour ASCII - Brett as an even younger Youngster doing Writing Research
Green!
Image as Colour ASCII - Brett slightly older at summer camp, making my parents proud
Blue!


Colours?
You want to know about the colours?
Then, I'll tell you about the colours.

Split the bands into R,G,B.
Take the max band and assign that as the color for each character.

Or, you know, keep a separate string for each picture,
save as text file,
load each file into Irfanview,
and BAMM!
Man, I love Irfanview.

Or if BAMM! in the above wasn't exactly clear:
save each band as a text file,
convert text to black and white image using Irfanview (BAMM!),
load each image into Python by
r = skimage.io.imread("redLayer.png")
and save by
skimage.io.imsave(sN, np.dstack((r,g,b)))

BAMM! BAMM! BAMM!
The triple layer colour whammy!

Image as Colour ASCII - Brett as a Youngster at Work
Oh, man!
Image as Colour ASCII - Brett as an even younger Youngster doing Writing Research
Look at
Image as Colour ASCII - Brett slightly older at summer camp, making my parents proud
those
Image as Colour ASCII - Brett not really a youngster anymore, more like a young punk, setting sail for adventure
colours.


Anyhow, my infatuation with Irfanview aside,
it turns out almost every pixel had more blue than anything else,
(maybe that's the nature of old time film)
so I normalized the bands by subtracting out the average hue of each:
average blue from blue, average red from red,
guess what I did for the green?


And, Walla!
Or Viola!

But I think, 'Walla!' looks better.

Image as Colour ASCII - Brett as a Youngster at Work
Dude!
Image as Colour ASCII - Brett as an even younger Youngster doing Writing Research
I think
Image as Colour ASCII - Brett slightly older at summer camp, making my parents proud
the ASCII
Image as Colour ASCII - Brett not really a youngster anymore, more like a young punk, setting sail for adventure
is kicking in.


And there you have it.
Proof of concept and a bit more to boot.


www.paufler.net


© Copyright 2015 Brett Paufler
Brett@Paufler.net
Terms of Service