← Back to browse

The Renoise Theme-to-Screenshot Preview System

A Pixel-Accurate Theme Preview Engine for Closed-Source Software


Abstract. This document covers a pixel-accurate theme preview system that renders Renoise Digital Audio Workstation (DAW) color themes without requiring a Renoise installation. The system maps every pixel in reference screenshots to semantic UI elements via binary pixel maps, then recolors those pixels using colors extracted from .xrnc theme files. The result is a three-pass rendering pipeline that produces Pattern Editor preview images indistinguishable from native screenshots — at a fraction of the computational and licensing cost.

1. Executive Summary

Renoise is a professional music tracker and Digital Audio Workstation used by electronic musicians worldwide. Like many DAWs, it supports custom color themes via .xrnc XML files containing 70+ color definitions. However, Renoise provides no built-in theme preview mechanism. Music producers who want to evaluate a theme must install it, restart Renoise, and manually inspect every view.

The Renoise Theme-to-Screenshot Preview System solves this by treating theme preview as a pixel recoloring problem rather than a UI rendering problem:

  1. Map every pixel in a reference screenshot to a semantic UI element
  2. Parse any .xrnc file to extract its color definitions
  3. Recolor the mapped pixels using the theme's colors
  4. Composite text and anti-aliased details using a special black/white text-mask theme

Key innovations:

2. The Problem Space

2.1 What is a Renoise Theme?

A Renoise theme is an XML file with the extension .xrnc (Renoise Color). It defines colors for 70+ UI elements, from the main application background (Main_Back) to the color of automation curve edges (Automation_Line_Edge).

<?xml version="1.0" encoding="UTF-8"?>
<SkinColors doc_version="12">
  <Main_Back>30,30,30</Main_Back>
  <Main_Font>220,220,220</Main_Font>
  <Body_Back>40,40,50</Body_Back>
  <!-- ... 70 more elements ... -->
</SkinColors>

These colors control every visible surface of Renoise's interface. Changing Main_Back affects roughly 46% of the screen. Changing VuMeter_Peak affects perhaps 0.01%.

2.2 The Preview Gap

Before this system existed, theme authors and curators faced three problems:

  1. No built-in preview. Renoise does not generate thumbnails or previews.
  2. Manual screenshots are inconsistent. Different users run different screen resolutions, window sizes, and song projects.
  3. Renoise is required. Generating a screenshot means having Renoise installed, licensed, and running.

2.3 Why Not Just Render the UI?

The most obvious solution — parse the theme and draw the UI from scratch — is infeasible. Renoise is closed-source. Its UI contains thousands of custom widgets, proprietary bevel and shading algorithms, and anti-aliased text with unknown font metrics. We needed a different approach.

3. System Architecture

The upload processing pipeline when a .xrnc file is uploaded:

StageModuleWhat It Does
1MulterHandles file upload, sanitizes filename, stores in public/uploads/themes/
2lib/parser.jsParses XML, extracts colors, assigns semantic roles with weights. Exports elementColorMap — single source of truth for all downstream steps.
3lib/categorize.jsConverts colors to HSL, runs weighted analysis to auto-tag themes (dark/light, neon/pastel, etc.)
4lib/palette.jsGenerates SVG palette strips tiered by MAIN/SECONDARY/UI/ACCENTS bands
5lib/preview-renderer.jsRenders PNG previews using the binary pixel map system (see Section 4)

All stages complete in under 2 seconds for a typical theme.

4. The Pixel Map System (Core Innovation)

4.1 Why Pixel Maps?

Think of it like a paint-by-numbers template. Every pixel has a number, and the theme file provides the color for each number. We never need to understand how Renoise draws its UI — only which element owns which pixel.

4.2 The White-Baseline + Green Probe Method

We generate 71 variant themes and capture them via headless automation:

StepAction
1Generate 1 baseline (every element = white) and 70 probes (one element = green, rest = white)
2Capture each variant screenshot via Renoise inside Xvfb headless display at 1920×1080
3Diff each probe screenshot against the white baseline — green-ish pixels belong to that element
4Resolve overlaps: smaller-coverage elements (text, icons) win over larger ones (backgrounds)

Compared to the original "rainbow voting" method, this approach has zero color collision risk and clean boundary definitions.

4.3 The Three-Pass Rendering Algorithm

Pass 1 — Paint Known Pixels: Iterate every pixel in the map. If the index is not 255 (UNMATCHED), paint with the theme's color using an O(1) lookup array.

Pass 2 — Fill Unmatched Pixels: Fill unpainted pixels by averaging colors of 8-connected neighbors. Critical: reads from the immutable pixel map (not the output buffer) to prevent fill propagation artifacts.

Pass 3 — Composite Text & Icons: Uses a special text-masking theme (all chrome = black, all text/icons = white) as an alpha mask. Rec.601 perceptual luminance converts B/W values to alpha, then blends text color over the existing pixel using standard alpha compositing.

4.4 Text Masking Theme

A special .xrnc theme renders everything black except text/icon pixels (white). Screenshotting with this theme produces an alpha mask. Rec.601 luminance (0.299R + 0.587G + 0.114B) accounts for human visual sensitivity to green. Known non-text elements (scrollbars, sliders, VU meters) are excluded from compositing.

5. The Theme Creator Tool

The creator at /create (login required) presents 70 color pickers ranked by pixel coverage, with live preview:

RankElementCoverage
1Main_Back46.38%
2Body_Back31.50%
3Button_Back6.61%
4ValueBox_Back4.10%
5Pattern_Default_Back3.51%
6Main_Font2.53%

This ranking is load-bearing: the top 10 elements control 97.9% of the visible screen. A user can create a recognizable theme in under 30 seconds.

6. Headless Automation Pipeline

Generating 71 screenshots is fully automated:

ToolRole
XvfbVirtual X11 display (1920×1080×24) — no physical monitor
xdotoolWindow detection and geometry verification
maimScreenshot capture by window ID
RenoiseThe DAW itself, with overridden config
Bash + PythonOrchestration, config injection, cleanup

Key optimization: temp config isolation (never touches user config), fast kill-9 restart cycle (~1 second per variant), plugin rescanning disabled, demo song loaded via CLI argument. Full 71-variant capture completes in ~3 minutes.

7. Results

MetricValue
Variants captured71 (1 baseline + 70 probes)
Elements mapped37
Matched pixels95.0%
Unmatched pixels5.9%

The system achieves pixel-perfect color assignment for all mapped elements, with zero Renoise code, assets, or runtime dependency on the server.

8. Future Work

9. File Index

Core Libraries

FilePurpose
lib/parser.jsParses .xrnc XML; extracts colors; assigns semantic roles and weights
lib/categorize.jsHSL conversion; weighted analysis for auto-tagging
lib/palette.jsWeighted SVG palette strip generation
lib/preview-renderer.jsThree-pass pixel map renderer: paint → fill → composite
lib/database.jsSQLite schema, prepared statements, auth
lib/xrnc-generator.jsTheme Creator .xrnc export

Automation Tools

FilePurpose
tools/generate-white-variants.jsGenerates 71 variant themes
tools/capture-variants.shHeadless bash pipeline: Xvfb → Renoise → maim
tools/build-diff-maps.jsBuilds pixel maps via green-delta detection

Map Assets

FilePurpose
maps/pattern.binFlat Uint8Array — 2,073,600 bytes at 1920×1080
maps/pattern.jsonWidth, height, ordered element name array
maps/pattern-text.pngCached text-theme screenshot for Pass 3
maps/*.svgVector outlines (future SVG renderer)

The demo song used during automated capture is by Hunz. The Renoise team built an extraordinarily customizable UI; this system exists to make that customization more accessible.

Document version 1.0 · Generated for the Renoise Themes open-source project