Correct way to use Selection (Lasso, Box) on an Image

As a concrete example of the difficulties: lasso selections on images are especially problematic. Suppose you have a 2000x2000 pixel image. That is 4 million individual indices. How do you compactly represent a lasso selection on an image? In general, a lasso selection region can have a completely arbitrary (and even disjoint) shape, so I am not sure you can do anything other than enumerate all the individual indices inside. But with images that could very easily grow to lists of hundreds of thousand or millions (or more) and that would have extremely bad performance implications.

As an alternative, you can get the raw selection geometry events and do whatever you need to do based on those. Ultimately that may be the best/only bet, certainly at least for now. But especially if you require lasso selections. I think we could potentially support point and rect and line selections on images, but I am skeptical about lasso support ever being feasible.

1 Like