# bootchk/resynthesizer architecture

> Architecture diagram of the GitHub repository bootchk/resynthesizer, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bootchk/resynthesizer
- Repository: https://github.com/bootchk/resynthesizer

## Overview

Resynthesizer is a GIMP plugin suite backed by a reusable C texture-synthesis engine. The principal result is synthesized or transformed image content: GIMP-facing code adapts drawable data and parameters for the engine, which performs synthesis. An expert control panel separately invokes the engine plugin through GIMP’s procedure database (PDB). The README names a broader plugin suite, but sampled plugin excerpts do not establish their individual runtime calls; those links are therefore omitted. The graph shows documented capabilities and only evidenced control-flow relationships.

Main entry points: [`lib/engine.c`](https://github.com/bootchk/resynthesizer/blob/master/lib/engine.c) (Synthesis engine), [`src/resynthesizer/resynthesizer.c`](https://github.com/bootchk/resynthesizer/blob/master/src/resynthesizer/resynthesizer.c) (Engine plugin), [`src/resynthesizer-gui/resynth-gui.c`](https://github.com/bootchk/resynthesizer/blob/master/src/resynthesizer-gui/resynth-gui.c) (Control panel), [`src/resynth-parameters.h`](https://github.com/bootchk/resynthesizer/blob/master/src/resynth-parameters.h) (Plugin parameters)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_plugins["GIMP Plugins"]
  node_heal_selection["Heal selection"]
  node_heal_transparency["Heal transparency"]
  node_map_style["Map style"]
  node_render_texture["Render texture"]
  node_enlarge["Enlarge"]
  node_fill_pattern["Fill pattern"]
  node_sharpen["Sharpen"]
  node_uncrop["Uncrop<br/>[plugin-uncrop.py]"]
end

subgraph group_integration["GIMP Integration"]
  node_control_gui["Control panel<br/>[resynth-gui.c]"]
  node_gui_widgets["Settings UI<br/>[resynth-gui.h]"]
  node_engine_plugin["Engine plugin<br/>[resynthesizer.c]"]
  node_gimp_adapter["Drawable adapter<br/>[adaptGimp.h]"]
  node_simple_adapter["Simple adapter<br/>[adaptGimpSimple.h]"]
  node_plugin_params["Plugin parameters"]
end

subgraph group_core["Synthesis Core"]
  node_engine_params["Engine parameters<br/>[engineParams.h]"]
  node_engine["Synthesis engine<br/>[engine.c]"]
  node_format["Image formats<br/>[imageFormat.h]"]
  node_maps["Image maps<br/>[map.h]"]
  node_ordering["Target ordering<br/>[orderTarget.h]"]
  node_search["Patch synthesis<br/>[synthesize.h]"]
  node_refinement["Threaded refinement<br/>[refinerThreaded.h]"]
end

node_gimp_user(("GIMP user"))

node_gimp_user -->|"opens controls"| node_control_gui
node_control_gui -->|"builds UI"| node_gui_widgets
node_control_gui -->|"reads settings"| node_plugin_params
node_control_gui -->|"invokes via PDB"| node_engine_plugin
node_gimp_user -->|"runs plugin"| node_engine_plugin
node_engine_plugin -->|"parses settings"| node_plugin_params
node_engine_plugin -->|"adapts drawables"| node_gimp_adapter
node_engine_plugin -->|"converts image"| node_simple_adapter
node_engine_plugin -->|"runs synthesis"| node_engine
node_engine -->|"uses parameters"| node_engine_params
node_engine -->|"uses formats"| node_format
node_engine -->|"operates on maps"| node_maps
node_engine -->|"uses target order"| node_ordering
node_engine -->|"synthesizes patches"| node_search
node_engine -->|"refines matches"| node_refinement

click node_heal_selection "https://github.com/bootchk/resynthesizer/blob/master/PluginScripts/plugin-heal-selection.py"
click node_heal_transparency "https://github.com/bootchk/resynthesizer/blob/master/PluginScripts/plugin-heal-transparency.py"
click node_map_style "https://github.com/bootchk/resynthesizer/blob/master/PluginScripts/plugin-map-style.py"
click node_render_texture "https://github.com/bootchk/resynthesizer/blob/master/PluginScripts/plugin-render-texture.py"
click node_enlarge "https://github.com/bootchk/resynthesizer/blob/master/PluginScripts/plugin-resynth-enlarge.py"
click node_fill_pattern "https://github.com/bootchk/resynthesizer/blob/master/PluginScripts/plugin-resynth-fill-pattern.py"
click node_sharpen "https://github.com/bootchk/resynthesizer/blob/master/PluginScripts/plugin-resynth-sharpen.py"
click node_uncrop "https://github.com/bootchk/resynthesizer/blob/master/PluginScripts/plugin-uncrop.py"
click node_control_gui "https://github.com/bootchk/resynthesizer/blob/master/src/resynthesizer-gui/resynth-gui.c"
click node_gui_widgets "https://github.com/bootchk/resynthesizer/blob/master/src/resynthesizer-gui/resynth-gui.h"
click node_engine_plugin "https://github.com/bootchk/resynthesizer/blob/master/src/resynthesizer/resynthesizer.c"
click node_gimp_adapter "https://github.com/bootchk/resynthesizer/blob/master/src/resynthesizer/adaptGimp.h"
click node_simple_adapter "https://github.com/bootchk/resynthesizer/blob/master/src/resynthesizer/adaptGimpSimple.h"
click node_plugin_params "https://github.com/bootchk/resynthesizer/blob/master/src/resynth-parameters.h"
click node_engine_params "https://github.com/bootchk/resynthesizer/blob/master/lib/engineParams.h"
click node_engine "https://github.com/bootchk/resynthesizer/blob/master/lib/engine.c"
click node_format "https://github.com/bootchk/resynthesizer/blob/master/lib/imageFormat.h"
click node_maps "https://github.com/bootchk/resynthesizer/blob/master/lib/map.h"
click node_ordering "https://github.com/bootchk/resynthesizer/blob/master/lib/orderTarget.h"
click node_search "https://github.com/bootchk/resynthesizer/blob/master/lib/synthesize.h"
click node_refinement "https://github.com/bootchk/resynthesizer/blob/master/lib/refinerThreaded.h"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_heal_selection,node_heal_transparency,node_map_style,node_render_texture,node_enlarge,node_fill_pattern,node_sharpen,node_uncrop,node_gimp_user toneBlue
class node_control_gui,node_gui_widgets,node_engine_plugin,node_gimp_adapter,node_simple_adapter,node_plugin_params toneAmber
class node_engine_params,node_engine,node_format,node_maps,node_ordering,node_search,node_refinement toneMint
```

## Components

### GIMP Plugins

- [Heal selection](https://github.com/bootchk/resynthesizer/blob/master/PluginScripts/plugin-heal-selection.py): `PluginScripts/plugin-heal-selection.py`
- [Heal transparency](https://github.com/bootchk/resynthesizer/blob/master/PluginScripts/plugin-heal-transparency.py): `PluginScripts/plugin-heal-transparency.py`
- [Map style](https://github.com/bootchk/resynthesizer/blob/master/PluginScripts/plugin-map-style.py): `PluginScripts/plugin-map-style.py`
- [Render texture](https://github.com/bootchk/resynthesizer/blob/master/PluginScripts/plugin-render-texture.py): `PluginScripts/plugin-render-texture.py`
- [Enlarge](https://github.com/bootchk/resynthesizer/blob/master/PluginScripts/plugin-resynth-enlarge.py): `PluginScripts/plugin-resynth-enlarge.py`
- [Fill pattern](https://github.com/bootchk/resynthesizer/blob/master/PluginScripts/plugin-resynth-fill-pattern.py): `PluginScripts/plugin-resynth-fill-pattern.py`
- [Sharpen](https://github.com/bootchk/resynthesizer/blob/master/PluginScripts/plugin-resynth-sharpen.py): `PluginScripts/plugin-resynth-sharpen.py`
- [Uncrop](https://github.com/bootchk/resynthesizer/blob/master/PluginScripts/plugin-uncrop.py): `PluginScripts/plugin-uncrop.py`

### GIMP Integration

- [Control panel](https://github.com/bootchk/resynthesizer/blob/master/src/resynthesizer-gui/resynth-gui.c): `src/resynthesizer-gui/resynth-gui.c`
- [Settings UI](https://github.com/bootchk/resynthesizer/blob/master/src/resynthesizer-gui/resynth-gui.h): `src/resynthesizer-gui/resynth-gui.h`
- [Engine plugin](https://github.com/bootchk/resynthesizer/blob/master/src/resynthesizer/resynthesizer.c): `src/resynthesizer/resynthesizer.c`
- [Drawable adapter](https://github.com/bootchk/resynthesizer/blob/master/src/resynthesizer/adaptGimp.h): `src/resynthesizer/adaptGimp.h`
- [Simple adapter](https://github.com/bootchk/resynthesizer/blob/master/src/resynthesizer/adaptGimpSimple.h): `src/resynthesizer/adaptGimpSimple.h`
- [Plugin parameters](https://github.com/bootchk/resynthesizer/blob/master/src/resynth-parameters.h): `src/resynth-parameters.h`

### Synthesis Core

- [Engine parameters](https://github.com/bootchk/resynthesizer/blob/master/lib/engineParams.h): `lib/engineParams.h`
- [Synthesis engine](https://github.com/bootchk/resynthesizer/blob/master/lib/engine.c): `lib/engine.c`
- [Image formats](https://github.com/bootchk/resynthesizer/blob/master/lib/imageFormat.h): `lib/imageFormat.h`
- [Image maps](https://github.com/bootchk/resynthesizer/blob/master/lib/map.h): `lib/map.h`
- [Target ordering](https://github.com/bootchk/resynthesizer/blob/master/lib/orderTarget.h): `lib/orderTarget.h`
- [Patch synthesis](https://github.com/bootchk/resynthesizer/blob/master/lib/synthesize.h): `lib/synthesize.h`
- [Threaded refinement](https://github.com/bootchk/resynthesizer/blob/master/lib/refinerThreaded.h): `lib/refinerThreaded.h`

### Other components

- **GIMP user**

## Connections

- GIMP user → Control panel: opens controls (evidence: `src/resynthesizer-gui/resynth-gui.c`)
- Control panel → Settings UI: builds UI (evidence: `src/resynthesizer-gui/resynth-gui.c`)
- Control panel → Plugin parameters: reads settings (evidence: `src/resynthesizer-gui/resynth-gui.c`)
- Control panel → Engine plugin: invokes via PDB (evidence: `src/resynthesizer-gui/resynth-gui.c`)
- GIMP user → Engine plugin: runs plugin (evidence: `src/resynthesizer/resynthesizer.c`)
- Engine plugin → Plugin parameters: parses settings (evidence: `src/resynthesizer/resynthesizer.c`)
- Engine plugin → Drawable adapter: adapts drawables (evidence: `src/resynthesizer/resynthesizer.c`)
- Engine plugin → Simple adapter: converts image (evidence: `src/resynthesizer/resynthesizer.c`)
- Engine plugin → Synthesis engine: runs synthesis (evidence: `src/resynthesizer/resynthesizer.c`)
- Synthesis engine → Engine parameters: uses parameters (evidence: `lib/engine.c`)
- Synthesis engine → Image formats: uses formats (evidence: `lib/engine.c`)
- Synthesis engine → Image maps: operates on maps (evidence: `lib/engine.c`)
- Synthesis engine → Target ordering: uses target order (evidence: `lib/engine.c`)
- Synthesis engine → Patch synthesis: synthesizes patches (evidence: `lib/engine.c`)
- Synthesis engine → Threaded refinement: refines matches (evidence: `lib/engine.c`)
