2325 posts Small, but tough
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Author had a File in an Envato Bundle
  • Contributed a Tutorial to a Tuts+ Site
  • Author had a Free File of the Month
  • Bosnia and Herzegovina
  • Referred between 500 and 999 users
+4 more
EFEKT_Studio says

So Felt, I have this prob…. sorry, I mean, guys I have this problem with expression.

Here is what I need. I need AE to read out certain pixels, for example 20×20 but only alpha value. (For example, precomposed vector logo). Expression would be on a certain layer’s opacity and basically it would be something like this:

if(most of the pixel’s readout from 20×20 pixel area alpha==1){ then this layer’s opacity is 100} else 0;

I was trying with sampleImage and from Dan Ebberts website, I found an expression which would be most similar, but I just cannot make it work the way I want:

target = thisComp.layer(“clouds”);

alpha = target.sampleImage(effect(“Lens Flare”)(“Flare Center”),[3.5, 3.5])[3];

linear(alpha, 0, 0.36, 80, 10)

Thanks in advance.

293 posts
  • Sold between 10 000 and 50 000 dollars
  • Beta Tester
  • Referred between 1 and 9 users
  • Has been a member for 2-3 years
  • Exclusive Author
  • Bought between 1 and 9 items
  • Belarus
DOGmotion says
I’m not Felt, but…
target = thisComp.layer("target_comp"); //comp from where you want to get alpha
samplePos = thisComp.layer("Eyedropper").transform.position;
//"Eyedropper" - null object, pick up location from wich to sample
r = 20; //radius
alpha = target.sampleImage(samplePos, [r,r], true, time);
if(alpha[3] >= 0.5) x = 100
else x = 0;
//if alpha in that location is less then 50% x = 0
[x]
That is all :)
2325 posts Small, but tough
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Author had a File in an Envato Bundle
  • Contributed a Tutorial to a Tuts+ Site
  • Author had a Free File of the Month
  • Bosnia and Herzegovina
  • Referred between 500 and 999 users
+4 more
EFEKT_Studio says

I’m not Felt, but…
target = thisComp.layer("target_comp"); //comp from where you want to get alpha
samplePos = thisComp.layer("Eyedropper").transform.position;
//"Eyedropper" - null object, pick up location from wich to sample
r = 20; //radius
alpha = target.sampleImage(samplePos, [r,r], true, time);
if(alpha[3] >= 0.5) x = 100
else x = 0;
//if alpha in that location is less then 50% x = 0
[x]
That is all :)

wow, it works!!!! Thank you so muuuuch! :)

293 posts
  • Sold between 10 000 and 50 000 dollars
  • Beta Tester
  • Referred between 1 and 9 users
  • Has been a member for 2-3 years
  • Exclusive Author
  • Bought between 1 and 9 items
  • Belarus
DOGmotion says

No problem, man ;)

5024 posts
  • Community Superstar
  • Elite Author
  • Community Moderator
  • Sold between 100 000 and 250 000 dollars
  • Author had a File in an Envato Bundle
  • Beta Tester
  • Has been a member for 5-6 years
+6 more
felt_tips Volunteer moderator says

Yeah…. what DOGmotion said. :)

73 posts Film Production
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Has been a member for 5-6 years
  • Author had a File in an Envato Bundle
  • Exclusive Author
  • Bought between 50 and 99 items
  • Envato Studio (Microlancer) Beta Tester
+2 more
PHANTAZMA says

Hey Felts, is it allowed to perhaps create a forum section on expressions we use to give to other authors? Or is that a noon? For instance, to help other folks, post expressions on controls I have made, or expressions used to help others?

73 posts Film Production
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Has been a member for 5-6 years
  • Author had a File in an Envato Bundle
  • Exclusive Author
  • Bought between 50 and 99 items
  • Envato Studio (Microlancer) Beta Tester
+2 more
PHANTAZMA says

Hey Felts, is it allowed to perhaps create a forum section on expressions we use to give to other authors? Or is that a noon? For instance, to help other folks, post expressions on controls I have made, or expressions used to help others?

I mean “No No”. Thanks spell check.

293 posts
  • Sold between 10 000 and 50 000 dollars
  • Beta Tester
  • Referred between 1 and 9 users
  • Has been a member for 2-3 years
  • Exclusive Author
  • Bought between 1 and 9 items
  • Belarus
DOGmotion says

Hey Felts, is it allowed to perhaps create a forum section on expressions we use to give to other authors? Or is that a noon? For instance, to help other folks, post expressions on controls I have made, or expressions used to help others?
It sounds like an idea for a new project… :zipped:
73 posts Film Production
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Has been a member for 5-6 years
  • Author had a File in an Envato Bundle
  • Exclusive Author
  • Bought between 50 and 99 items
  • Envato Studio (Microlancer) Beta Tester
+2 more
PHANTAZMA says

Just thinking usually if I am trying to figure out how to do a specific expression of course I search the web and usually find what I need. But perhaps create a resource of expressions that may help each other and save have to scour the internet.

599 posts
  • Author had a Free File of the Month
  • Sold between 10 000 and 50 000 dollars
  • Envato Studio (Microlancer) Beta Tester
  • Bought between 1 and 9 items
  • Referred between 10 and 49 users
  • Exclusive Author
  • Has been a member for 2-3 years
addeystock says

Hey Felts, is it allowed to perhaps create a forum section on expressions we use to give to other authors? Or is that a noon? For instance, to help other folks, post expressions on controls I have made, or expressions used to help others?

+1

by
by
by
by
by
by