02-08-2026, 03:23 PM
(02-08-2026, 02:15 PM)ersc57 Wrote: Hi Scallact,
This is what I am thinking of...
Purpose: select an aera of a layer which should be filled with a new background by IOPaint.
what I am intending to do is:
copy the active layer to a new image (using edit_copy & edit_paste_as_new_image)
save this image to pass it on to IOPaint lateron
make the new image background black (using ?)
copy the selection to the new image (using image_get_selecten & save_selection)
make the selection white (using ?)
so then we have created a mask.
save this mask to disk (using an image)
Then feed the new image saved earlier and the mask to IOPaint
Insert the returned layer in the current image above the active layer
Set the original active layer to non-visible.
I don't know if this will work. Sometimes GIMP does not allow copying items from one image to another.
And how to make a selection white?
Ok, I think you will have to clear up some terms used here. Also, I don't fully understand the logic behind your steps yet, and I've got the feeling that you're over complicating it. So I can't give you detailed commands for every step, because you might just not end up anywhere. ;-)
First, terminology:
What do you mean by "mask"? Apparently, it's not about a GIMP layer mask. Is it a mask that you pass to IOPaint ? Can you describe what this mask looks like? Is it a typical black/white layer that serves as mask (but still a layer for GIMP)?
"Make the selection white". You don't make a selection white, you fill it with white, on a specific drawable (a drawable can be a layer, a layer mask, a channel, etc...)
Steps:
If I understood the mask thing right, why not create it on the first image, where you already have the selection active? This would save you the transfer of the selection to another image.
Even more simplification: since apparently you must save an image to the disk (and the mask I guess?), why not do it from the original image as well? I don't know, just suggestions.

