02-07-2026, 09:18 PM
(02-07-2026, 03:23 PM)Scallact Wrote:(02-07-2026, 08:54 AM)ersc57 Wrote: Hi there, I am working on extending GIMP with AI functions. I ditched Photoshop lately and my pals at the Photo Club keep telling me that I am a fool to have ditched PS with all it's nice AI functions. They shouldn't say that to me...
At this moment I've got AI Remove Background working, using IOPaint that runs locally on my laptop. It still needs some fine tuning, but it works.
Now I am working on 'inpaint' (filling a selection with a generated background). I am struggling now how to make a mask from a selection. The GIMP API has many procedures, but just copying a selection seems not to be easy. Is there anyone who has some experience with this?
P.S. I am new to Gimp Forum, so maybe I missed earlier questions/discussions like this.
Layer > Mask > Add layer mask, chose "Selection"
Sorry, I must have been unclear. I want to create a mask from a selection using python code. I would very much like to know which gimp procedures to use for achieving this. I am thinking of edit_copy and edit_paste_new_image, but the first has a drawable is argument and the second an image. So maybe it's not straightforward.

