Reading every pixel from one layer

Scripting for After Effects

Reading every pixel from one layer

Postby DocsVisuals on 04/28/2015, 4:36 am

Hello,
I will have to work with expressions for a new VFX project. The basic idea is to read the whole color information of one layer
pixel by pixel and then save the whole thing in an array. Then copy that image information and paste it to another layer.
In real time of course. I already know how to program (in Java), so the programming won't be a problem. But I could need some help
to figure out the whole pixel-reading thing out. I will only work with black and white images.
Is this doable in AE CS 6?
I already did some research and found the method sampleImage which will read the color information at a certain location on the layer and
a certain radius and will produce a average which is then saved in an array. So wouldn't it be possible to iterate through all locations,
set the radius to 1 (or is it 0?) and save all that in a big array? Is that the right idea, am I on the right track?
Thanks in advance,
DocsVisuals :)
DocsVisuals
 
Posts: 4
Joined: 01/11/2014, 4:04 am

Re: Reading every pixel from one layer

Postby star+circle on 05/1/2015, 12:37 am

Maybe an explanation of what effect you are trying to achieve would clarify the issue. Copying the whole image pixel by pixel -- why? Why don't you copy the whole image as an image?
star+circle
 
Posts: 729
Joined: 12/6/2014, 3:07 pm
Location: Finland

Re: Reading every pixel from one layer

Postby DocsVisuals on 05/2/2015, 4:30 am

star+circle wrote:Maybe an explanation of what effect you are trying to achieve would clarify the issue. Copying the whole image pixel by pixel -- why? Why don't you copy the whole image as an image?

I want to work with video feedback and with that I don't mean working with the Time FX in After Effects. In real life I would point a camera on a screen, which shows the output of the camera itself. So my idea was to use Particular which uses itself as a source layer. But apparently that is not possible in Particular, so I thought of just copying the current frame to another comp/layer and use that one as a source.
DocsVisuals
 
Posts: 4
Joined: 01/11/2014, 4:04 am

Re: Reading every pixel from one layer

Postby Mylenium on 05/3/2015, 1:15 am

DocsVisuals wrote:The basic idea is to read the whole color information of one layer
pixel by pixel and then save the whole thing in an array.


Arrays are limited to 1024 entries. At best you will have to construct a data field from nested arrays. The rest is completely unclear. Sounds like you are trying to do a simple thing the very hard way.

Mylenium
[Pour Mylène, ange sur terre]
----------------------------------------
www.myleniumblog.com
Mylenium
 
Posts: 3263
Joined: 02/1/2009, 11:45 am
Location: Germany
System Specs: Have, I do!

Re: Reading every pixel from one layer

Postby star+circle on 05/3/2015, 1:13 pm

It definitely sounds like some sort of time blending would do the job, way easier. I mean we're really talking about copying the (entire) video image from an earlier point in time at a smaller scale into the video recursively. I'd definitely look into the Time Blend effects for something like this. It is very likely you can make it work that way. If that doesn't work for some reason, it would still be easier to copy the layer multiple times, scale and time offset the copies to give the desired effect. No need to do that pixel by pixel that I can think of.
star+circle
 
Posts: 729
Joined: 12/6/2014, 3:07 pm
Location: Finland


Return to After Effects Expressions