01-24-2018, 11:38 PM
1) pdb.gimp_image_select_item(image, operation, item). The API and the UI have different goals, they aren't always identical.
2)
But why do you need this? You can work on the mask, it is a drawable and can be used in most calls that you use with a layer. Try this:
2)
Code:
image.add_layer(pdb.gimp_layer_new_from_drawable(layer.mask,image),0)
- create an empty image (single white layer)
- add an alpha channel to that
- add a layer mask
- put some black on the mask to create transparent holes
- remember that at this point your editoing goes to the mask (as stated in the status bar at the bottom)
- start the wand tool and click on your layer. The marching ants circle the holes
- in the Layers list, click on the Layer preview and check that the status bar tells you that you are now edting the layer and no longer the mask
- still with the wand, click on you layer (in the holes or not). The marching ants are along the canvas boundaries
- the wand doesn't care about opacity
- fuzzy select works on a layer mask so if you want to select by opacity you can use the mask directly (note that the mask will be a one bit-per-pixel drawable, so the pixels in the tiles have a single element).