From 7b782fe37d97d2e394226af4bd883f4510027fb7 Mon Sep 17 00:00:00 2001 From: Maniu Date: Sun, 25 May 2025 21:50:49 +0200 Subject: [PATCH] Update python-fu-removebg.py fix mask part --- python-fu-removebg/python-fu-removebg.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python-fu-removebg/python-fu-removebg.py b/python-fu-removebg/python-fu-removebg.py index 3fdf424..73b73cd 100644 --- a/python-fu-removebg/python-fu-removebg.py +++ b/python-fu-removebg/python-fu-removebg.py @@ -149,12 +149,12 @@ class PythonRemoveBG(Gimp.PlugIn): if asMask: image.select_item(Gimp.ChannelOps.REPLACE, newlayer) + copyLayer = newlayer.copy() image.remove_layer(newlayer) - copyLayer = Gimp.layer_copy(curLayer) image.insert_layer(copyLayer,None, -1) - mask = copyLayer.create_mask(ADD_SELECTION_MASK) + mask = copyLayer.create_mask(Gimp.AddMaskType.SELECTION) copyLayer.add_mask(mask) - Gimp.selection_none(image) + image.get_selection().none(image) image.undo_group_end() Gimp.displays_flush()