03-11-2018, 10:02 PM
(03-11-2018, 01:00 PM)dinasset Wrote: Hi.
I'm playing a bit with 2.9.9 and to train myself I started writing some very small filters.
This one is not ORIGINAL, i.e. has not been invented by me: I took a couple of two small existing filters (in .scm), combined into just one and ported into python.
The original filters are:
- Alexia Death's script-fu-lomo-effect and Avi Bercovich's script-fu-lomo
Comments, critics, suggestions are welcome.
If someone is interested in the originals I attach here also those.
They are the versions I have in my folders, menu has been modified, they will appear under BestFilters/Photo/Effects (I do not remember the original menu).
My filter will appear under menu="<Image>/Diego/Ancillary2"
**cough**
Code:
pdb.gimp_context_push()
currFG = pdb.gimp_context_get_foreground()
currBG = pdb.gimp_context_get_background()
# [... snip ...]
pdb.gimp_context_pop()
pdb.gimp_context_set_foreground(currFG)
pdb.gimp_context_set_background(currBG)
Context push/op operations are designed precisely to avoid saving/restoring colors and other context elements (pattern, font, gradient...)
Otherwise, what is specific to 2.9.x in the code?