batch processing with the fuzzy select tool - Printable Version +- Gimp-Forum.net (https://www.gimp-forum.net) +-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP) +--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP) +---- Forum: Scripting questions (https://www.gimp-forum.net/Forum-Scripting-questions) +---- Thread: batch processing with the fuzzy select tool (/Thread-batch-processing-with-the-fuzzy-select-tool) |
batch processing with the fuzzy select tool - DThompson55 - 07-18-2021 I'm new to scripting, but I have a programming background, so I think I can do this. I have Python skills. I have a short movie, which I've exported to 570 individual png files. What I want to do is apply the fuzzy select tool, with a selectivity of 70, smack dab in the center of each png, cut the resulting selection, and save the file somewhere that doesn't overwrite the original. I thought I might be able to do this using bimp, I've got it running, but it doesn't seem to support the gimp_image_select_contiguous_color function that I would need to do this. Maybe, or maybe I'm looking at it wrong. When I start googling gimp scripting I find posts going back to the last century. I don't know what the best current methodology is, nor how to get started? I don't want to waste time reading obsolete documentation or approaches to the problem. So I thought i'd ask here. I'm running on MacOS Big Sur running GIMP 2.10 RE: batch processing with the fuzzy select tool - rich2005 - 07-18-2021 First of all the caveat: Although I do use BIMP I am no coder, so very probably doing something basically wrong. One problem with BIMP is some 'commands' are blacklisted, '-save, -free, -select ...' for example, which means the command you want does not show. The way around this is put the commands into a python plug-in and call the plug-in using BIMP's 'Other GIMP procedure' I keep a BIMP boilerplate script and your procedure might look like this, nothing clever, very linear in operation Code: #!/usr/bin/env python EDIT: If you try that remember to save it as something.py, put it in your user profile plugins folder and make it executable. That registers in the Tools menu and you can try it on an individual image. The problem is now BIMP and in particular BIMP version 2.x Apply that to the images and it renders 100% transparent images. An older version BIMP 1.8 works OK, so it looks to me like a BIMP 2.x problem. A shame you are using MacOS where only a BIMP 2.5 is available. FWIW As an example, a 50 second animation using BIMP 1.8 https://i.imgur.com/lEmFeKq.mp4 You might be able to run the script from command line, I have never had much success there. I will leave that for the clever guys RE: batch processing with the fuzzy select tool - Ofnuts - 07-18-2021 An exemple here: https://stackoverflow.com/questions/44430081/how-to-run-python-scripts-using-gimpfu-from-windows-command-line/44435560#44435560 This is for Windows but it states the changes for Linux/OSX. RE: batch processing with the fuzzy select tool - DThompson55 - 07-18-2021 (07-18-2021, 03:15 AM)DThompson55 Wrote: I solved it a different way. I used a macro / keystroke recorder to replay the mouse clicks and buttons I used, ran it in a loop, and it worked just fine with no coding. Always more than one way to skink a cat. |