some functions missing from procedure browser

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

some functions missing from procedure browser

Developers mailing list
I'm using gimp 2.10.18. Most functions are easily found in the
procedure browser, but some don't appear to be there. I don't see
these:

- Filters>Blur>Median Blur
- Filters>Blur>Mean Curvature Blur
- Colors>Auto>White Balance
- Colors>Tone Mapping>Mantiuk 2006

Are they available to script-fu? If so, how can they be found?
_______________________________________________
gimp-developer-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list
Reply | Threaded
Open this post in threaded view
|

Re: some functions missing from procedure browser

Øyvind Kolås-2
On Thu, Dec 24, 2020 at 4:20 AM ian martins via gimp-developer-list
<[hidden email]> wrote:

> I'm using gimp 2.10.18. Most functions are easily found in the
> procedure browser, but some don't appear to be there. I don't see
> these:
>
> - Filters>Blur>Median Blur
> - Filters>Blur>Mean Curvature Blur
> - Colors>Auto>White Balance
> - Colors>Tone Mapping>Mantiuk 2006
>
> Are they available to script-fu? If so, how can they be found?

I do not think so. GIMP/scrip-fu is lacking a way to apply arbitrary
available GEGL operations to a drawable. For the cases where GEGL
operations have taken over the load from gimp-plugins, GIMP developers
have added PDB wrappers/integration for each op, similar to how it had
to be done with plug-ins. To expose the above operations to script-fu
either more PDB wrappers need to be written or a generic mechanism to
invoke a GEGL op (this will be better for the future; since it means
less boiler plate code needed in many places in GIMP for each bit of
added functionality.)

Merry Yuletide, /pippin
_______________________________________________
gimp-developer-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list
Reply | Threaded
Open this post in threaded view
|

Re: some functions missing from procedure browser

Developers mailing list
In reply to this post by Developers mailing list
I will answer (at least for Median Blur), but I am not a developer, and
someone else might know better.

ScriptFu calls procedures in the PDB, so yes, if it is not in the PDB, you
probably can't call it from ScriptFu ( and the PDB browser would not omit
anything.)

Just browsing the code:

app/actions/filter-actions.c seems to show that the menu item in GIMP calls
gegl:median-blur

pdb/groups/plug_in_compat.pdb seems to be Perl code that generates PDB
procedures for many GEGL filters.  And "Median" is not found there.

This page
https://wiki.gimp.org/wiki/Hacking:Porting_filters_to_GEGL#Display_filters
seems to show the history of porting Gimp filters to GEGL, and Median Blur
is not there.

I don't know why Median Blur was not made available in the PDB, possibly it
was just an oversight.

I don't know of any more general way to call a GEGL filter from ScriptFu.
In Gimp 3, in another language such as Python, you could use GObject
Introspections to call GEGL, but ScriptFu does not use GI (it only
introspects and calls PDB procedures).  Maybe it is  possible to modify the
ScriptFu interpreter to provide a Scheme function to call any GEGL filter.

Again, I could be wrong, maybe it IS there, just hard to find.
_______________________________________________
gimp-developer-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list
Reply | Threaded
Open this post in threaded view
|

Re: some functions missing from procedure browser

Developers mailing list
In reply to this post by Developers mailing list
We don't need to enhance Script-Fu to be gegl aware.
We just need a plugin that is gegl aware.
Call the plugin "python-fu-do-gegl-op."

Given a drawable, an operation name like "gegl:median-blur" and a list of
arguments (usually all numeric)
the plugin invokes the gegl operation on the drawable.
Gegl is introspectable, it will tell you the types for parameters to any
operation,
and the plugin can check and convert arguments if needed, or substitute
defaults.

The plugin could be written in Python, which can introspect both Gimp and
Gegl.
When the plugin is introspecting the Gegl op, it is second-order
introspecting.
You can't write the plugin in ScriptFu because it doesn't support GObject
Introspection.
You could write the plugin in C, but easier in a higher language.

A ScriptFu script calls the plugin in the PDB:
(python-fu-do-gegl-op drawable "gegl:median-blur" ( 1, 2.0, ...))

All gegl ops SHOULD be in the PDB, but when they are not,
you fall back to this plugin.
_______________________________________________
gimp-developer-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list
Reply | Threaded
Open this post in threaded view
|

Re: some functions missing from procedure browser

Developers mailing list
In reply to this post by Developers mailing list
I tried my suggestion.  It seems like Gimp.Drawable.apply_operation(node)
is necessary but not exposed in libgimp.  A pipe dream then.
_______________________________________________
gimp-developer-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list