api icon indicating copy to clipboard operation
api copied to clipboard

Is there an API to fetch the lasso selected areas info.?

Open zhengying opened this issue 2 years ago • 1 comments

I want to fetch lasso-selected areas information, but I can't find API related. if there is no API for that, is there any plan for this feature?

zhengying avatar Jun 25 '22 13:06 zhengying

Hi @zhengying, there were plans to add a Image:pixels(selection) but it wasn't implemented yet (Image:pixels).

I think there are two possible workarounds:

  1. to create a temporary layer, fill it with some color, clear the region, then iterate all the pixels that are masked to know where the region was located, and then restore the selection back. Anyway it's not simple.
  2. other possibility is iterating the Selection.bounds and checking if each pixel is in the selection with Selection:contains

dacap avatar Jun 27 '22 13:06 dacap