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?


1 Answer 1


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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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