QArt Tuner

Generates QR codes whose data modules form a recognizable image, using the QArt technique by Russ Cox. Lives in utils/qart/.

Quick Reference

ItemValue
Sourceutils/qart/main.go
LanguageGo (managed via mise)
Dependencyrsc.io/qr (BSD 3-clause)
Launch web UIQART_IMAGE=photo.png mise run serve (from utils/qart/)
CLImise x go -- go run . -url URL -image IMG -out out.png

How It Works

QR error correction (Reed-Solomon coding) allows some data and check bits to be freely chosen. The tool:

  1. Builds a QR code plan for the given URL and version
  2. Converts the source photo to a grayscale brightness grid at QR module resolution
  3. For each ECC block, models the data/check bit relationships as a matrix over GF(2)
  4. Uses Gaussian elimination to find which bits can be independently assigned
  5. Assigns bits to match the target image brightness, prioritizing high-contrast areas

The result is a valid, scannable QR code whose black/white modules approximate the source image.

Web UI

The interactive tuner (-serve flag) provides sliders for all parameters with live preview.

Keyboard shortcuts: arrow keys (dx/dy offset), [/] (mask), -/= (version), r (rotate).

Parameters

ParameterRangeEffect
version1-8QR density — higher = more modules = finer detail
mask0-7QR mask pattern — dramatically affects which pixels are controllable
dx/dy-15 to 15Shifts image relative to QR structure (avoids alignment dot on eyes)
rotation0-3Quarter turns
scale1-16Output pixels per QR module
ditheron/offFloyd-Steinberg dithering

Credits

  • Technique: Russ Cox, QArt Codes (2012)
  • QR library: rsc.io/qr — QR layout, encoding, GF(256) arithmetic
  • Implementation: Claude Code (Opus 4.6) with direction from Erich Blume
  • mise-tasks — Task runner for BlumeOps operations