Skip to content

Repository files navigation

Patchwork

Patchwork is a node-based image editor/patcher for Linux. It uses G'MIC and ImageMagick image processing frameworks. You load an image input, connect processing nodes using wires, and render the output.

Features

  • Node graph editor: drag, drop, and connect nodes to build image processing pipelines visually
  • G'MIC filters: auto-discovered from your local G'MIC installation (Sketch, Oil Painting, Denoise, Retinex, and hundreds more)
  • ImageMagick operations: blur, sharpen, resize, rotate, color adjustments, edge detection, morphology, and more
  • Built-in node types: Input, Output, Filter, Blend (12 modes), Color Adjust, Opacity, Coloring (HSL), and Mask
  • Math and logic nodes: Basic math operators and logic gates
  • Adaptive UI: responsive layout that works on narrow windows and mobile (thanks to Libadwaita)

Requirements

DependencyMinimum versionNotes
Python3.10+
GTK4.0via PyGObject
Libadwaita1.0via PyGObject
PyGObject3.50Python GTK bindings
Pillow10.0Python imaging library
G'MIC (gmic)anyCLI — required for G'MIC filters
ImageMagick (magick)anyCLI — required for blends, color ops, masks
blueprint-compileranyBuild-time only

Installation


### From source (Meson)
```bash
# Install system dependencies
# Debian/Ubuntu:
sudo apt install python3-gi python3-gi-cairo gir1.2-gtk-4.0 gir1.2-adw-1 \
meson blueprint-compiler gmic imagemagick
# Fedora:
sudo dnf install python3-gobject gtk4 libadwaita meson blueprint-compiler \
gmic ImageMagick
# Arch:
sudo pacman -S python-gobject gtk4 libadwaita meson blueprint-compiler \
gmic imagemagick
# Build and install
meson setup build
meson compile -C build
sudo meson install -C build

Quick development run (no install)

./run.sh

This compiles the UI blueprints on the fly and launches Patchwork directly from the source tree.

Getting started

  1. Open an image: click the folder icon in the sidebar (or press Ctrl+O)
  2. Browse filters: the sidebar lists all available filters and nodes organized by category
  3. Add a filter: drag a filter from the sidebar onto the canvas, or double-click it
  4. Connect nodes: click and drag from an output port (right side of a node) to an input port (left side of another node)
  5. Tweak parameters: click a filter node to adjust its parameters
  6. Render: click the Render button in the toolbar to process the graph
  7. Export/Save: once rendered, click the save icon to export the result and save your project

Node types

NodeColorPurpose
InputGreenLoads an image from disk
OutputRedMarks the final result
FilterBlueApplies a G'MIC or ImageMagick filter
BlendBrownCombines two or more images (12 blend modes)
Color AdjustTealBrightness, contrast, hue, saturation
OpacityPurpleAdjusts transparency
ColoringCyanHSL color adjustments
MaskDark TealMask-based compositing

Keyboard shortcuts

ShortcutAction
Ctrl+OOpen image
Ctrl+SExport result
Ctrl+QQuit
Ctrl+PToggle preview
Ctrl+ReturnApply filter
Ctrl+RReset parameters
Ctrl+TBefore / After comparison
Ctrl++Zoom in
Ctrl+-Zoom out
Ctrl+MToggle minimap

Project structure

Patchwork/
├── data/ # Desktop file, AppStream metadata, icons
├── src/
│ ├── main.py # Entry point
│ ├── application.py # App lifecycle, actions
│ ├── window.py # Main window, signal wiring
│ ├── models/ # Filter definitions, app state
│ ├── nodes/ # Graph data structure, node types
│ ├── widgets/ # Node canvas, filter browser, comparison, parameters
│ ├── processing/ # Graph executor, threaded runner
│ ├── gmic/ # G'MIC CLI integration, stdlib parser
│ ├── imagemagick/ # ImageMagick CLI integration, built-in filters
│ ├── resources/ # Blueprint UI files
│ └── style.css # Application stylesheet
├── flatpak/ # Flatpak build manifest (Flathub-ready)
├── .github/ # CI workflows
├── meson.build # Top-level build definition
├── Makefile # Developer convenience wrappers
├── pyproject.toml # Python package metadata
└── run.sh # Quick development launcher

License

Patchwork is distributed under the GNU General Public License v3.0. See the LICENSE file for details.

About

Node-based image processing environment with a modern GTK4 interface

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages