motion graphics eXchange
top

Ascii animation with sampleImage()

Thumbnail for: Ascii animation with sampleImage()
More experimentation with sampleImage().
from http://www.creative-workflow-hacks.com
After Effects CS3
Useful things
Expressions

Views: 3655
Permalink
visit |  share this  error? 
This one relies on this expression.
target = thisComp.layer("layerToSample.mov");
samples = new Array();

var spacing = 10;
var w = target.width / spacing ;
var layerOrder = 1;
var h = 10 * layerOrder;

letters = "   .,:!-+=;iot76x0s&8%#@$";

for(x= 0; x < w; x++){
   samples[x] = target.sampleImage([x* spacing ,h],[spacing , spacing], false, time);
}

var string = '';

for(z = 0; z < samples.length; z++){
   var y = Math.round((0.299 * samples[z][0] + 0.587 * samples[z][1] + 0.114* samples[z][2]) * 100)/ 4;
   string = string + letters.substring(y,y + 1);

}
We loop through the row of pixels and place the sampled RGB pixels in the samples array, convert the RGB samples to YUV and grab the Y or brightness value for comparison against a rough gradient of ASCII values. For best results, use a monospace font to retain proper spacing.

Keywords

sampleImage RGB YUV

(Min. Version: After Effects CS3, Category: Useful things, Type: Expressions)
posted by mmo on Sep 02, 2008

 

Related topics:

Invisible Cape

Thumbnail for: Invisible Cape
In this video tutorial, Creative Cow contributing editor Eran Stern with the help of his brother Yuval will show you a simple method to create the famous invisible look inspired from the movie "The Predator"
After Effects CS3
Keying
Video-/Tutorials

Views: 1752
Permalink
posted by peter17 on Oct 01, 2008

Modulate the intensity of Lens Flare based on an obscuration layer

Thumbnail for: Modulate the intensity of Lens Flare based on an obscuration layer
With this preset you can cause the opacity of a layer to control the brightness of a "Lens Flare".
After Effects CS3
Lights
Presets (ffx)

Views: 4073
Permalink
posted by mmo on Feb 20, 2009

CC Light Rays based on layer's alpha

Thumbnail for: CC Light Rays based on layer's alpha
With this preset you can prevent "CC Light Rays" to cause a light spot if it's not over an opaque part of a layer.
After Effects CS3
Lights
Presets (ffx)

Views: 6537
Permalink
posted by mmo on Feb 24, 2009


 

 

follow us on http://twitter.com/mgxchangegoogle+get in touch on facebook

 

 

Full length video training series presented by motion graphics industry professionals. Click here to visit Motionworks website!