PythonFuSamples | Python-Fu samples and templates for GIMP
kandi X-RAY | PythonFuSamples Summary
kandi X-RAY | PythonFuSamples Summary
Python-Fu samples is a package that contains 12 scripts, developed using Python and GIMP 2.8, which objective is to serve as templates and as code samples to programmers that are new in Python-Fu scripting. In order to install these scripts, you must copy them in the plug-ins folder of GIMP (normally GIMP 2/lib/gimp/2.0/plug-ins). After installed, the scripts can be found in Filters -> Test .
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of PythonFuSamples
PythonFuSamples Key Features
PythonFuSamples Examples and Code Snippets
Community Discussions
Trending Discussions on PythonFuSamples
QUESTION
I'm trying to do some batch processing with Python-fu and just can't get my script to work.
When I try to call some methods in pdb, such as pdb.plug_in_nlfilt()
, the plug in won't register.
I'm building off the test_batch_invert.py example here. That example works and it processes files as intended, but the code below does not register. All these pdb functions work individually in the python console when I have an image up to process.
Any ideas? Also, when I comment out all the problematic pdb calls and the plugin does register, it shows up grayed out in the menu unless I have an image open. Is there a way to make it functional in the menu without having to manually open another image file?
Thanks everyone!
-- EDIT: Fixed some typos with the name 'layer' but that did not solve it.
...ANSWER
Answered 2020-Jun-07 at 21:17Works for me, sort of, after a couple of fixes but these aren't the PDB calls:
Your registration declares 2 args (in & out directories) and your function takes 4. There used to be default image and layer args, but the registration mantras have changed a bit over time. Image and layer as the first two args are processed specifically, but if you want them you need to declare them in the registration. The menu location
is deprecated since Gimp 2.6 so your example is vastly outdated.
The "\" as a file separator doesn't work on Linux and OSX. "/" works everywhere, even on Windows, but it is more proper to use
os.path.join()
.
Once this is done the script runs for me (Gimp 2.10.14 on Linux). I assume it looks for file with specific characteristics because if it runs the results are strange :)
The menu is grayed out until you open an image because your image type is "*"
which is an image of any type, instead of ""
(empty string) that doesn't need any image.
This said, you don't need to register the script/plugin to use it in batch mode, see here for an example.
Some hints to debug Gimp python scripts on Windows here.
PS: as far as I know, the gimp_wire_read(): error
message can be ignored, it it not caused by your script/plugin.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install PythonFuSamples
You can use PythonFuSamples like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page