Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Searching for python script islands to layers
#24
(01-24-2018, 11:38 PM)Ofnuts Wrote: 1) pdb.gimp_image_select_item(image, operation, item). The API and the UI have different goals, they aren't always identical.

2)
Code:
image.add_layer(pdb.gimp_layer_new_from_drawable(layer.mask,image),0)
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:
  • 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
This tells you two things:
  • 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).
3) Sorry, read some doc to fast, I thought I had seen an Opacity criterion. But then see 2)

Thanks I learned a few new things today, I never looked at the status bar at the bottom to see which layer you are working at, very nice tips!
Reply


Messages In This Thread
RE: Searching for python script islands to layers - by mich_lloid - 01-25-2018, 12:17 AM

Forum Jump: