Gimp-Forum.net
ofn-extract-objects usage - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: General questions (https://www.gimp-forum.net/Forum-General-questions)
+--- Thread: ofn-extract-objects usage (/Thread-ofn-extract-objects-usage)



ofn-extract-objects usage - TheWaveWarden - 01-17-2021

Hi I'm using Gimp 2.10 on Debian. I'm trying to use the ofn-extract-objects script, but can't get it running.

I am fearly certain I installed it correctly, since when putting the .py file in the userspace plug-ins folder as well as the system folder, Gimp will say "Ignoring duplicate plugin". I also checked that the execution bit is set on the .py.

So maybe I am just blind? The documentation says

The script is called using the entries in the

Code:
Layer>Extract objects
sub-menu in the image window.

I assume the "Layer" menu in the top-bar between "Image" and "Color" is meant? I have no "Extrace objects" menu in there. Am I looking in the wrong direction? Undecided


RE: ofn-extract-objects usage - eepjr24 - 01-17-2021

Caveat: I don't have that ofn plugin installed, I am going off the way other ofn plugins work for me.

I think it means you need to right click (rmb) the layer in the layers panel and select Extract Objects from the pop up menu.

- E


RE: ofn-extract-objects usage - rich2005 - 01-17-2021

First where to put plug-ins.  One location or the other (preferably not both although the User profile should supercede the root version)
If your computer has multiple user accounts and each uses Gimp then put the plug-in in the root plugins directory
Just for your use, then it goes in your Gimp user profile, ~/.config/GIMP/2.10/plug-ins/
(If a flatpak Gimp then there is a flatpack user profile, look in the Gimp menu Edit -> Preferences -> Folders and in plug-ins check the paths.)

Not a plugin I normally use, I think aimed at animation makers, however in use looks like this.

[attachment=5488]

Which gives two objects each on its own layer.

[attachment=5489]

edit: If you give details of your requirements, there are other plugins that have similar functions.


RE: ofn-extract-objects usage - Ofnuts - 01-17-2021

(01-17-2021, 01:19 PM)TheWaveWarden Wrote: Hi I'm using Gimp 2.10 on Debian. I'm trying to use the ofn-extract-objects script, but can't get it running.

I am fearly certain I installed it correctly, since when putting the .py file in the userspace plug-ins folder as well as the system folder, Gimp will say "Ignoring duplicate plugin". I also checked that the execution bit is set on the .py.

So maybe I am just blind? The documentation says

The script is called using the entries in the

Code:
Layer>Extract objects
sub-menu in the image window.

I assume the "Layer" menu in the top-bar between "Image" and "Color" is meant? I have no "Extrace objects" menu in there. Am I looking in the wrong direction? Undecided

Have you got Python support installed for Gimp? On recent Ubuntu you need to explicitly install the gimp-python package. If you have Python support you should have a Filters>Python-fu>Console menu.

Gimp uses Python 2.7 which is now deprecated, so recent distros (Ubuntu 20.04, in particular) no longer install Python v2 by default, and have no gimp-python package in their repos (though it appears you can use those of earlier distros, after explciitly istalling Python v2).


RE: ofn-extract-objects usage - rich2005 - 01-18-2021

Well, from the OP post

Quote: I'm using Gimp 2.10 on Debian. I'm trying to use the ofn-extract-objects script, but can't get it running.
I am fearly certain I installed it correctly, since when putting the .py file in the userspace plug-ins folder as well as the system folder, Gimp will say "Ignoring duplicate plugin". I also checked that the execution bit is set on the .py.

To me that does imply that python is working to a degree (ie. Gimp will say "Ignoring duplicate plugin")

Debian 10 buster (stable) comes with Gimp 2.10.8 and gimp-python packages. What comes with Debian testing or unstable, not sure.

@TheWaveWarden - more information please on what you are using. Debian / Gimp versions / Using a Chromebook linux installation etc ?


RE: ofn-extract-objects usage - Ofnuts - 01-18-2021

(01-18-2021, 10:45 AM)rich2005 Wrote: To me that does imply that python is working to a degree (ie. Gimp will say "Ignoring duplicate plugin")

Debian 10 buster (stable) comes with Gimp 2.10.8 and gimp-python packages.  What comes with Debian testing or unstable, not sure.
 
@TheWaveWarden - more information please on what you are using.  Debian / Gimp versions / Using a Chromebook linux installation etc ?

Also, you can edit the pluginrc file in your Gimp profile and search for ofn-extract-object, you should see something like:

Code:
(plug-in-def "/path/to/installed/ofn-extract-objects.py" 1600028527
    (proc-def "python-fu-ofn-extract-objects-files" 1
         "Extract objects to files"
         "Extract objects to files\n/path/to/installed/ofn-extract-objects.py"
         "Ofnuts"
         "Ofnuts"
         "2017"
         "Extract objects to files..."
         1
        (menu-path "<Image>/Layer/Extract objects")
        (icon icon-name -1 "")
         "*"
         7 0
        (proc-arg 0 "run-mode" "The run mode { RUN-INTERACTIVE (0), RUN-NONINTERACTIVE (1) }")
        (proc-arg 13 "image" "Input image")
        (proc-arg 16 "layer" "Input layer")
        (proc-arg 0 "resize" "Layer size")
        (proc-arg 3 "threshold" "Alpha threshold")
        (proc-arg 4 "directory" "Directory")
        (proc-arg 4 "namePattern" "File name pattern"))
    (proc-def "python-fu-ofn-extract-objects-layers" 1
         "Extract objects to layers"
         "Extract objects to layers\n/path/to/installed/ofn-extract-objects.py"
         "Ofnuts"
         "Ofnuts"
         "2017"
         "Extract objects to layers..."
         1
        (menu-path "<Image>/Layer/Extract objects")
        (icon icon-name -1 "")
         "*"
         6 0
        (proc-arg 0 "run-mode" "The run mode { RUN-INTERACTIVE (0), RUN-NONINTERACTIVE (1) }")
        (proc-arg 13 "image" "Input image")
        (proc-arg 16 "layer" "Input layer")
        (proc-arg 0 "resize" "Layer size")
        (proc-arg 3 "threshold" "Alpha threshold")
        (proc-arg 4 "namePattern" "Layer name pattern")))

Where of course /path/to/installed/ is something else on your machine. The (menu-path items tells you where the menu entry is (<Image>/Layer is the Layer dropdown in the menu bar of an image window)