ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Creating a color picker using the sampleImage expression

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Oscar Gomez
Creating a color picker using the sampleImage expression
on Jan 22, 2018 at 12:35:40 am

Hey everyone, I have a question regarding an expression to link the colour of a layer to the position of a point control.

So far this is what I've got:

colorPicker = effect("Color_01")("Point");
colors = thisComp.layer("Color_pallet")

colors.sampleImage(colorPicker,radius = [.5, .5],postEffect = true, t = time)

This works for everything in my comp so far. I've got a colour pallet layer with all the colours the point controllers in my layers are sampling the colours from. My issue is that whenever I bring in a psd image with an alpha and apply a fill effect to it, which then is linked to the colour pallet via the expression above, it always turns the colour to black. It seem to not take into consideration the expression at all.

It would be awesome if someone knows how to fix this issue. Here's a screenshot of the problem:




Thanks for your help!


Return to posts index

Dan Ebberts
Re: Creating a color picker using the sampleImage expression
on Jan 22, 2018 at 1:22:17 am

If all of your layers aren't comp-sized and centered, you'll need to translate the sample coordinates into the "colors" layer space. I'm guessing it will be something like this (I haven't tested it though):

colors.sampleImage(colors.fromComp(toComp(colorPicker)),radius = [.5, .5],postEffect = true, t = time)


Dan



Return to posts index

Oscar Gomez
Re: Creating a color picker using the sampleImage expression
on Jan 22, 2018 at 1:58:30 am

Thanks for the reply Dan!

I see what you are saying. Basically in order for this to work no problem my assets need to be precomposed and then there wouldn't be a problem.

I just tried the solution you posted and either I did it wrong or it didn't work ☹



Is there something I should be doing differently?

Thanks again for the help!

Oscar


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]