Gimp-Fu scripting discussion
Printed From: Pixel Joint
Category: The Lounge
Forum Name: Resources and Support
Forum Discription: Help your fellow pixel artists out with links to good tutorials, other forums, software, fonts, etc. Bugs and support issues should go here as well.
URL: https://pixeljoint.com/forum/forum_posts.asp?TID=738
Printed Date: 27 October 2025 at 4:36pm
Topic: Gimp-Fu scripting discussion
Posted By: neota
Subject: Gimp-Fu scripting discussion
Date Posted: 17 August 2005 at 10:11pm
I designate this thread a place to discuss python scripting with
Gimp. show scripts, talk about how to do stuff,..
-----
Info:
The greatness of scripting your own commands is mainly :
a) You can define your own menu structure
b) You can add keyboard shortcuts for any of the commands you add (for
instance, I have 'prev fgcolor in range' mapped to '[' and 'next
fgcolor in range' mapped to ']')
pyGimp provides access to the gimp PDB plus constants (like
INDEXEDA_IMAGE and RGBA_IMAGE for specifying what kind of image you
want to create) and a few helping functions, plus wrapping the major
gimp objects so they are easier to manipulate.
Gimp-Fu is a simplified plugin interface, which can automatically
construct the GUI for any of your scripts needing additional parameters.
-----
Most scripts will work on the currently selected image or layer.
My scripts may require a recent version of Gimp.
These are the scripted commands I have coded:
* Ditherfill selection (both singlecolor+transparency and bicolor..
third variant puts it on a layer for further editing), using custom
ditherpatterns.
* Add FGcolor to palette (cause it's a pain to DnD it)
* Interpolate duplicates ( looks at your current palette, and makes
gradients across the duplcated range.. like if you have a blue, then 4
duplicated whites, that becomes
blue->blue-blue-white->blue-white->white-b lue->white)
* Interpolate FG->BG (finds FG and BG colors in the palette, blends
between them across the intermediate palette entries)
* Pixelperfect outline (outlines the current selection by exactly 1 pixel.. you can then fill the outline.)
* Color stencil: Removes all the colors in a given palette from the
selection. Like a read-only mode for individual colors. idea is
straight from Dpaint
* BG -> FG replace : replaces all instances of BGcolor in current palette with FGcolor.
* Next/Prev fgcolor in defined range or entire palette:
By editing the color names to specify next/prev relative indices, you
can define ranges (otherwise, you can just move through the entire
palette). In the simplest case, where the range colors are all adjacent
in the palette, you just need to set the name of the start color to
'PREV,0' and the name of the end color to 'NEXT,0'
Usable, slightly slow. Needs optimization, the palette-searches are slowing it down currently.
If you want these, email me (or offer to upload them somewhere!
They're only 10k zipped currently, but I have no place to put them on
the web.)
(My planned and in progress scripting commands
will go here.. once i've arranged the list.)
|
|