I've been using sampleImage to scan a layer's alpha channel with great success.
Until I started working with vector layers.
These are my issues:
The sampleImage function works differently on Shape Layers and Text Layers -
It scans the layer using composition's dimensions and not the layer's -- meaning that if a text layer is off the screen than the sampleImage will not find any non-transparent pixels.
This is unlike AV Layers in which sampleImage scans the layer itself regardless of position in the comp. So even non-transparent pixels that are off the comp's screen are scanned.
Is there anyway around this and sample a text or shape layer regardless of the comp? I can think of a very long way to get this done using a duplicate comp resized to match the sourceRecAtTime of the text/shape layer, solo the layer and scanning the duplicate precomp but that seems like a hassle...
Another issue I found is with Vector footage layer (e.g. an illustrator file) that has the Collapse Transformations switch enabled -- sampleImage returns completely different values than with this switch disabled... haven't figured out the pattern yet. Anyone encountered this before?
Thanks a bunch
Roy