GIMP Version: 2.8.18
Operating System: Windows
GIMP Experience: Basic Level
Likely a stupid question for a wise scripter, but for me that's the first time I have this need.
Assuming -
1) the filter receives an image (and a drawable) in input
2) the user made a selection on the input drawable before calling the filter
3) the filter becomes aware of this fact simply thru:
(select, x1, y1, x2, y2) = pdb.gimp_drawable_mask_bounds (inDrawable)
if select == True : # there is a selection
......
4) the filter wants to keep the source image as it is and work on a new image, created with the same dimensions, and creates the background by copying the input drawable, like
outImage = pdb.gimp_image_new (width, height, type)
outBG = pdb.gimp_layer_new_from_drawable (inDrawable, outImage)
Now, the new image has no selection (it's not copied by the new_from_drawable statement).
Hence the question:
how can I copy the selection from the source so that the outBG is "exactly" corresponding to the source inDrawable?Thanks a lot