SIGN IN
::
SPONSORS
::
ABOUT US
::
CONTACT US
FORUMS
TUTORIALS
MAGAZINE
TRAINING
VIDEOS - REELS
PODCASTS
EVENTS
SERVICES
NEWSLETTER
NEWS
BLOGS
ADOBE AFTER EFFECTS:
Home
Forum
Basics
Expressions
Tutorials
Podcasts
Motion Graphics
Training
Cinema 4D
FAQ
Re: Video to ASCII effect
Cow Forums
:
Adobe After Effects Expressions
VIEW POSTS
•
ADD A NEW POST
•
SEARCH
•
CHANGE FORUM
Respond to this post
•
Return to posts index
•
Read entire thread
Re: Video to ASCII effect
by
Patrick Deen
on Nov 6, 2007 at 1:30:39 pm
You've probably set your character size too small if you only see the bounding boxes ;-)
I've commented Dan's expression for you. Hope it helps you to understand it :-)
One other thing, you can make your own set of characters ranging from light to dark. I wasn't really fond of the "@" as the darkest character so I've altered the desity string to suit my taste.
Here's the commented expression;
density = " .'`,^:" + '";~-_+<>i!lI?/|()1{}[]rcvunxzjftLCJUYXZO0Qoahkbdpqwm*WMB8&%$#@';
/* "density" is just a string ordered with characters from light to dark (" " is white and "@" is black).You can access each character from this string as an array. "density[1]" would be "." since array entries start counting by zero (desity[0] = " ") */
target = thisComp.layer(index -1);
/* the target variable will hold the reference to the layer above the texts layer where you've added this expression */
cols = 80; //number of characters/columns that make up the width of the grid
rows = 60; //number of characters/rows that make up the height of the grid
w = thisComp.width/cols;
// dividing the width by the number of columns gives you the width of each "cell" in the grid
h = thisComp.height/rows;
// dividing the height by the number of columns gives you the height of each "cell" in the grid
s = "" // this declares an empty variable to hold the string that makes up your ascii art
// Next comes a nested loop that makes it all happen...
for (var i = 0; i < rows; i++){ // adding the rows
/* the value of "i" is zero, repeat this action while "i" is smaller than the number of rows, increment "i" with one after each execution of the embedded script */
//the real nested loop
for(var j = 0; j < cols; j++){ // adding the columns to the row
/* the value of "j" is zero, repeat this action while "j" is smaller than the number of columns, increment "j" with one after each execution of the script */
center = [w/2 + j*w, h/2 + i*h];
// divide the width/height of the cell in half and add j times the width/height to that value results in the centre-point of each cell
sample = target.sampleImage(center,[(w-1)/2,(h-1)/2]);
// uses the "center" variable for the position and sets the size of the point to be sampled based on the size of your grid-cells. sample will hold an array of three numbers between 0 and 1 (1=white and 0=black)
s += density[Math.round(linear(sample[0],0,1,0,density.length - 1))];
// the variable "s" is incremented with a character from the "desity" string. The expression between the straight brackets uses the first value of the sampled color in the sample variable to produce an integer/rounded number which is used to select the character to add to the string "s"
}
s += "r"; // After a row is completed this adds a new line to the text until all rows are built.
}
s // in the end the completed string is echoed by this simple notation and this is what shows up on the text layer.
Respond to this post
•
Return to posts index
•
Read entire thread
Current Message Thread:
Video to ASCII effect
by jporter313 on Oct 25, 2007 at 11:11:27 pm
Re: Video to ASCII effect
by Dan Ebberts on Oct 26, 2007 at 12:14:09 am
Re: Video to ASCII effect
by jporter313 on Oct 26, 2007 at 12:56:14 am
Re: Video to ASCII effect
by moldyboot on Oct 26, 2007 at 4:00:29 pm
Re: Video to ASCII effect
by Dan Ebberts on Oct 26, 2007 at 5:31:42 pm
Re: Video to ASCII effect
by Patrick Deen on Oct 30, 2007 at 11:04:52 pm
Re: Video to ASCII effect
by jporter313 on Nov 5, 2007 at 7:08:27 pm
Re: Video to ASCII effect
by jporter313 on Nov 6, 2007 at 12:08:15 am
Re: Video to ASCII effect
by Patrick Deen on Nov 6, 2007 at 1:30:39 pm
Re: Video to ASCII effect
by jporter313 on Nov 6, 2007 at 5:20:56 pm
Re: Video to ASCII effect
by Patrick Deen on Nov 6, 2007 at 7:07:09 pm
Re: Video to ASCII effect
by jporter313 on Nov 6, 2007 at 11:39:30 pm
Re: Video to ASCII effect
by jporter313 on Nov 6, 2007 at 11:54:24 pm
Re: Video to ASCII effect
by Patrick Deen on Nov 7, 2007 at 5:56:10 pm
Re: Video to ASCII effect
by jporter313 on Nov 7, 2007 at 6:01:00 pm
Re: Video to ASCII effect
by Patrick Deen on Nov 7, 2007 at 6:04:31 pm
Re: Video to ASCII effect
by jporter313 on Nov 7, 2007 at 7:30:38 pm
Re: Video to ASCII effect
by Olivier Vincent on Aug 28, 2008 at 2:36:04 am
Re: Video to ASCII effect
by Olivier Vincent on Aug 28, 2008 at 5:03:00 pm
Re: Video to ASCII effect
by Patrick Deen on Aug 28, 2008 at 8:10:01 pm
Re: Video to ASCII effect
by Olivier Vincent on Aug 29, 2008 at 1:08:08 am
Re: Video to ASCII effect
by Eric Manevy on Nov 15, 2008 at 5:52:56 pm
Re: Video to ASCII effect
by Patrick Deen on Nov 15, 2008 at 7:07:10 pm
Re: Video to ASCII effect
by Eric Manevy on Nov 15, 2008 at 9:32:18 pm
Re: Video to ASCII effect
by Patrick Deen on Nov 6, 2007 at 5:27:16 pm
Note:
If you are a registered user please
click here to login
before posting.
Your post will not be accepted if your name and email address are not registered in our database. Click
here
if you do not have an account.
Name
E-Mail Address
Subject
E-Mail me when someone responds
Just This Message
Entire Thread
None
Message:
Note:
The following are HTML characters and may cause parts of your post to disappear if not used correctly: < > &
To include any portion of the post in your response, highlight the desired text and hit the "Q" key.
Read more...
Please post Expressions Code in the box below:
Add your message signature
Note:
By clicking "Post Direct" button above, you are agreeing to the Creative Cow's
Code of Conduct
.
FORUMS
•
TUTORIALS
•
MAGAZINE
•
TRAINING
•
VIDEOS - REELS
•
PODCASTS
•
EVENTS
•
SERVICES
•
NEWSLETTER
•
NEWS
•
BLOGS
©
CreativeCOW.net
All rights are reserved.
[
Top
]