2351 posts Small, but tough
  • Has referred 500+ members
  • Has sold $125,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 100+ items on Envato Market
+9 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.

341 posts
  • Made it to the Authors' Hall of Fame
  • Has sold $10,000+ on Envato Market
  • Has referred 1+ members
  • Has been a beta tester for an Envato feature
+4 more
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 :)
2351 posts Small, but tough
  • Has referred 500+ members
  • Has sold $125,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 100+ items on Envato Market
+9 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! :)

341 posts
  • Made it to the Authors' Hall of Fame
  • Has sold $10,000+ on Envato Market
  • Has referred 1+ members
  • Has been a beta tester for an Envato feature
+4 more
DOGmotion says

No problem, man ;)

5114 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $125,000+ on Envato Market
  • Has been part of the Envato Community for over 5 years
  • Helps us moderate the forums
+11 more
felt_tips Volunteer moderator says

Yeah…. what DOGmotion said. :)

73 posts Film Production
  • Has referred 10+ members
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has been a beta tester for an Envato feature
  • Has collected 50+ items on Envato Market
+7 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
  • Has referred 10+ members
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has been a beta tester for an Envato feature
  • Has collected 50+ items on Envato Market
+7 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.

341 posts
  • Made it to the Authors' Hall of Fame
  • Has sold $10,000+ on Envato Market
  • Has referred 1+ members
  • Has been a beta tester for an Envato feature
+4 more
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
  • Has referred 10+ members
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has been a beta tester for an Envato feature
  • Has collected 50+ items on Envato Market
+7 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
  • Has referred 10+ members
  • Has sold $40,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 1+ items on Envato Market
+5 more
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