README.md

Splotch & Blot

A small Paint-like image editor for Linux, written in Go with GTK4. Requires Go 1.27 or newer to build.

Native GTK4 application

Linux-first. The approved github.com/diamondburned/gotk4/pkg binding is pinned in go.mod. cmd/native has hand-drawn SVG tool/action icons, a GNOME-style header bar and main menu, tool options, a color well whose popover has a hue ring and hue/white/black triangle plus a hex field (live, starting from the current color), a quick palette, zoom and status controls (click the zoom percentage for a custom 5–1600% level; status fields identify cursor and selection), and a scrollable canvas with canvas-edge handles. Drawing tools, fill/stroke controls, a Text tool (T) that types directly on the canvas (click to place; Enter for new lines; drag the dashed box to move it; font face and pixel size in the tool options bar; palette/color changes apply live; Ctrl+Enter, clicking outside, or switching tools applies it as one undo step; Esc or Ctrl+Z discards it), movable rectangular selection, clipboard copy/paste, undo/redo, select all/clear/crop, scale with aspect lock, canvas-only resize, file drop, and PNG/JPEG open/save are available (JPEG export does not change the working document path). Unsaved changes are confirmed before discarding or closing. The canvas limit is 8000 pixels per dimension.

Paint bucket and curves

  • Bucket (B): choose a color and click to fill a connected area. Tolerance defaults to 24 on a 0–255 scale; 0 selects the clicked color exactly, and larger values include more similar shades. Matching is relative to the clicked pixel, with four-way connectivity (diagonal-only contacts do not join regions). Smooth edges is on by default: it estimates coverage at nearby anti-aliased boundaries and replaces the old background contribution, avoiding a pale inner fringe without requiring high tolerance. Turn it off for strict pixel-color matching or pixel art. Edge reconstruction is local and approximate for flattened images, especially very thin or textured outlines. A fill is one undo step; filling an already matching area does not clear redo or mark the document changed.
  • Curve (C): drag from the start to the end of the line, then move the pointer to preview a bend. Click, or drag and release, to apply the bend. This is a single-bend quadratic Bézier curve that passes through the bend point. The current color and stroke width apply. Enter applies the preview; Esc or Ctrl+Z cancels it without changing the image. Switching tools or saving also applies the preview as one undo step.
  • Continue a line: with Line or Curve selected, Shift+click uses the last committed line/curve endpoint as the start and the click as the new endpoint. Shift+drag also works. For a curve, bend and apply it as usual afterward. Straight and curved segments can be mixed, each with its own undo step. Changing tools, color, width, or zoom does not break the chain; another drawing/image edit does. Undo/redo restores the corresponding continuation point, and canceling an unfinished curve keeps the previous one. Without a previous endpoint, Shift behaves like an ordinary click/drag.

Stickers

Select Sticker (K): clicking the tool button opens a picker beside it, grouped into tabs: Comic (speech, thought, shout and whisper bubbles, caption box, burst), Marks (arrow, curved arrow, circle mark, check, cross, question, exclamation, pin), Nature (cloud, sun, moon, lightning, raindrop, snowflake, flower, leaf, tree, paw print, fish, bird), Symbols (star, heart, crown, music note, lightbulb, gear, banner, badge) and Decor (sparkle, paint splat, swirl, dots, motion lines, tape). The options-bar button reopens it; next to it, Rotate turns the sticker 90° clockwise and Flip mirrors it (for arrows and bubble tails). Stickers are monochrome and use the current drawing color. Outline sets the line width in image pixels (it stays the same at any sticker size), and Solid fills the shape; inner details such as the pin hole or the question mark are cut out when solid. A translucent preview follows the pointer at the real size: click to place it centered there, or press and drag outward to size it by eye. A dragged size becomes the Size (px) for later clicks. Each placement is a separate undo step, rendered from SVG at that size and flattened into the raster canvas.

From the project directory, build in the local arch-dev distrobox (GCC, GTK4 development libraries and introspection headers are installed there), then run the resulting binary on the host:

sh
1distrobox enter arch-dev -- sh -lc 'CGO_ENABLED=1 go test -tags gtk ./... && CGO_ENABLED=1 go build -tags gtk -o splotch-blot ./cmd/native'
2./splotch-blot

No host compiler installation is needed. If another Splotch & Blot window has unsaved art, use SPLOTCH_BLOT_INDEPENDENT=1 ./splotch-blot for a separate test instance instead of replacing it. Tests require the gtk tag; the untagged root server has been removed.

About displays version 1.0.0 and the Git commit recorded in Go's build metadata. Builds without VCS metadata show unknown; builds from an uncommitted checkout mark the commit as modified. Rebuild after committing to show the new commit in About.

Desktop launcher and icon

The icon is assets/org.splotchblot.SplotchBlot.svg (scalable); the About dialog uses its bundled 256px rendering in cmd/native/icon.png, so it also works when launched directly from the checkout. After building, install the binary and desktop assets for this user to show Splotch & Blot in the app launcher (run from the project directory):

sh
1install -Dm755 splotch-blot "$HOME/.local/bin/splotch-blot"
2install -Dm644 assets/org.splotchblot.SplotchBlot.desktop "$HOME/.local/share/applications/org.splotchblot.SplotchBlot.desktop"
3install -Dm644 assets/org.splotchblot.SplotchBlot.svg "$HOME/.local/share/icons/hicolor/scalable/apps/org.splotchblot.SplotchBlot.svg"

Ensure ~/.local/bin is on your desktop session's PATH; the launcher accepts a PNG or JPEG file argument. To regenerate the embedded raster after editing the SVG, run rsvg-convert -w 256 -h 256 assets/org.splotchblot.SplotchBlot.svg -o cmd/native/icon.png before rebuilding. The desktop file and icon share the native app ID, org.splotchblot.SplotchBlot.

The native UI uses GTK4, not libadwaita; choose and approve a separate binding before importing one. Layer support and a native project format are future steps; text is rasterized when applied, and PNG/JPEG remain flattened exports. JPEG export flattens against the white canvas background. History stores up to 30 regional raw-pixel snapshots within a 512 MiB budget (retaining at least the most recent edit); selection outlines and a floating selection are not restored as live selections by undo/redo (their visible pixels are preserved).