Skip to content

Developer's guide to the Resynthesizer code and dependencies

Lloyd Konneker edited this page May 18, 2025 · 3 revisions

The major parts of the source code:

  • /lib Produces libresynthesizer.a, a convenience library implementing the algorithm.
  • /enginePlugin Produces resynthesizer, an executable GIMP plugin calling the library. Adapts GIMP data structures and calling conventions to the library. Statically linked with the library. The "base" or "engine" plugin.
  • /outerPlugins/plug-in-*.scm GIMP plugins written in Scheme, invoking the engine plugin via GIMP PDB

Obsolete, for version 2:

  • /src/resynthesizer the source for the engine plugin
  • /src/resynthesizer-gui Produces resynthesizer-gui, an executable GIMP plugin written in C, a control panel for and invoking resynthesizer engine plugin via GIMP PDB.
  • /PluginScripts/plugin-*.py GIMP plugins written in Python, invoking the engine plugin via GIMP PDB

An informal picture of dependencies

outer 
plugins -> gimp-script-fu-interpreter-3.0 -> libgimp-3.0
                                          -> engine plugin -> libresynthesizer -> GLib
                                                                               -> libm
                                                                               -> libgthreads (optional)
                                                           -> libgimp-3.0      -> GLib
                                                                               -> other libraries

Run-time dependencies

The resynthesizer library is independent of GIMP. By default it does compile-time depend on Glib, but optionally can be built without Glib.

The outer plugins call a Scheme interpreter embedded in GIMP. The outer plugins and the engine plugin register in the GIMP PDB, the Procedural Data Base. Plugins can call other plugins in the PDB, including the "engine" plugin also in the PDB, but not interpreted.

The C language "resynthesizer" plugin is the base, the engine plugin. It calls no other plugins. It does call the GIMP library (libgimp) because it is a GIMP plugin. It also calls the resynthesizer library.

All other resynthesizer "outer" plugins call the engine plugin, so there is a run-time dependency. Also, they have a run-time dependency on the Scheme (ScriptFu) interpreter embedded in the GIMP app (more precisely in libgimp.)

All plugins beside the engine plugin are optional, at the discretion of the user at install time.

Filters>Map>Resynthesize...

The outer plugin whose menu item is "Filters>Map>Resynthesize..." is a "control panel" for raw access to the engine. Without it, all other plugins will still work. It is only for advanced users who want to use the engine in novel ways. Advanced users must understand the arguments to the engine plugin.

It does not affect the operation of any other outer plugin.

Link-time, library dependencies

The resynthesizer library uses the C math library (libm) and optionally, when threaded, libgthreads.

The library also uses GLib (for things like gassert and g_uint) but the repository includes hacky, compile-time options to obviate that.

The resynthesizer engine plugin links with the GIMP library, libgimp, but the resynthesizer library does not.

Python dependencies for Resynthesizer 2 (obsolete)

The resynthesizer Python plugins use Python 2, which is obsolete since January 2020.

The resynthesizer Python plugins use GimpFu (also called PyGimp) i.e. the Python module "gimpfu." That is, they "from gimpfu import *."

The resynthesizer Python plugins also import some Python standard modules, but no other modules that are not standard.

The GimpFu module is a feature of GIMP v2. The gimp.org has no plans to support it in GIMP v3. But there is a third party effort to support it as a third-party plugin (see https://github.com/bootchk/GimpFu-v3.git). For now, the future "deprecations" branch has Python plugins that use Python 3 and the third-party GimpFu.

Clone this wiki locally