Skip to main content
Inspiring
September 2, 2013
Answered

sampleImage() in 4-color gradient issue

  • September 2, 2013
  • 1 reply
  • 853 views

hi there

I am trying a technique for logo/element removal that I saw in a post from a couple years back, where a tracked, solid "patch" is placed over the unwanted element, and a 4 color gradient effect is applied to the patch, which then uses the sampleImage() method to grab local colors around the element.

I've gotten it working fine with the below code, except for one problem: when I parent my null (acting as a "color picker" position) to the original tracking info, the color no longer samples properly. Unparenting the null makes the sampling work fine, but then, I have to hand key the null, which is a pain and doesn't produce great results.

myPoint = thisComp.layer("Null 1").transform.position;

target = thisComp.layer("myAwesomeFootage.avi")

target.sampleImage(target.fromWorld(myPoint), radius = [1, 1], postEffect = true, t = time)

Any tips on getting around this parenting problem?

thanks!

ML

This topic has been closed for replies.
Correct answer Mylenium

You need to add an extra toWorld() layer space transform to convert the layer coordinates to comp/ world coordinates.

Mylenium

1 reply

Mylenium
MyleniumCorrect answer
Legend
September 2, 2013

You need to add an extra toWorld() layer space transform to convert the layer coordinates to comp/ world coordinates.

Mylenium