to answer your prior post, yes, [1] would return just the saturation value.
some thing like this may work for you:
target = thisComp.layer(“footage”); //this need to point at your footage layer
samplepoint= [20,300];
samplesize= [20,20];
lum = rgbToHsl(target.sampleImage(samplepoint,samplesize))[2];
linear(lum, 0, 1, 20, 80)
i don’t have cs3 at home, so i can’t test this (sampleImage was introduced in cs3), but i think it should work. the first 3 lines are variables, you need to make sure the target is your footage layer. you can modify the samplesize and samplepoint as needed.
the samplepoint is relative to the footage layer, not the comp. what that means is if the footage is the same size as the comp and not repostioned, no problem. but if it is different, then the easy solution would be to add a point control effect (from expression controls) to the footage layer, then direct the samplepoint to the point control effect. so that line might look like this:
samplepoint=target.effect(“Point Control”)(“Point”);
you can then just move the point control point around to sample different areas of the footage…. it may be the easier way to go if you wanted to start this way.
the last line will take some adjusting, based on your footage and what you are going for. the first 2 numbers (0,1) are the input range. you may want to tighten these based on your footage, maybe (.25,.75) or something to get a better sample.
the last 2 numbers are the output range… if you were applying this to say opacity, the you coulg go use (0,100) for full range, but iff you didn’t want the value to drop bellow 30 or get higher than 70, the you would use (30,70) for the output range…
Kevin Camp
Senior Designer
KCPQ, KMYQ & KRCW