3
$\begingroup$

I'm trying to use a Locator for some image processing tasks. Unfortunately, the images we're using have a high dynamic range of low-frequency black and white features. I've made a custom Appearance for the Locator with some concentric circles that works pretty well, but am wondering about using other compositing operations instead, like, Xor.

The current implementation of Locator seems to composite with a simple Over operator. Meaning that the 'cross hairs' disappear on black patches.

Has anyone successfully created a more dynamic locator appearance or have some thoughts about how one might do that?

$\endgroup$
7
$\begingroup$

I don't think you can change the compositing operator but you can dynamically change the appearance. A simple example:

im = LinearGradientImage[];

DynamicModule[{pt = {10, 10}},
 LocatorPane[Dynamic[pt], im, Appearance -> Graphics[{
     Dynamic @ GrayLevel[1 - PixelValue[im, pt]], Disk[]}, ImageSize -> 20]]]

enter image description here

$\endgroup$
  • $\begingroup$ Ah! I hadn't thought of using PixelValue[]- beautifully simple, thanks mate! $\endgroup$ – flip Apr 10 '16 at 8:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.