02-10-2026, 07:45 PM
(02-09-2026, 04:33 PM)ersc57 Wrote: Terminology:
You are right, by mask I mean an image with one layer that is pure black with a selection that is pure white. This is one of the input files for IOPaint inpaint.
The selection should indeed be filled with white.
Just a few tips :
To copy a selection to another image, use
Code:
SavedSelection = Gimp.Selection.save(YourImage)and load the selection from the chanel with:
Code:
YourImage.select_item(Gimp.ChannelOps.REPLACE, SavedSelection)I didn't test the transfer to another image, but this should work.
To fill a selection with white:
Code:
YourLayer.edit_fill(Gimp.FillType.WHITE)https://lazka.github.io/pgi-docs/#Gimp-3....edit_fill
The python doc: https://lazka.github.io/pgi-docs/#Gimp-3.0

