Gimp-Forum.net

Full Version: Python-fu delete selection
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This is my first project with python-fu.  I have a routine I need to do on hundreds of images, a few times on each image. 

What I need to do is

1. Select a color using pdb.gimp_image_select_color
2. Delete the contents of that selection

This is the equivalent of

1. Using the Select By Color Tool (Shift O)
2. Hitting the delete button on the keyboard


I can create the selection but I am not sure how to delete the contents within the selection. Can someone steer me in the right direction for what I need to do next or point me towards an example?

Many thanks
That's pdb.gimp_edit_clear(layer). In the python console, hit Browse and you have all the doc (granted, that one is well hidden). To make a script that runs on many files, see this (I am the author of the answer, so you can ask here on G-F.n if you have any questions).
(03-28-2018, 06:13 AM)Ofnuts Wrote: [ -> ]That's pdb.gimp_edit_clear(layer). In the python console, hit Browse and you have all the doc (granted, that one is well hidden). To make a script that runs on many files, see this (I am the author of the answer, so you can ask here on G-F.n if you have any questions).

PERFECT!!!! Exactly what I needed. I threw in pdb.python_fu_heal_selection() and successfully completed what I needed to do

Thank you so much!