Farb-Match — ein Foto in der Stimmung eines anderen einfärben

Übernimmt die Farbstimmung eines Referenz-Fotos und legt sie auf Ihr Zielbild. Ideal um Fotos aus unterschiedlichem Licht zu harmonisieren, einen ganzen Shoot auf ein Hero-Bild abzustimmen, Screenshot-Paletten zwischen Light- und Dark-Mode anzugleichen oder verwaschene Alt-Aufnahmen passend zu einem modernen Look anzuwärmen. Eine Referenz fixieren, beliebig viele Targets durchschicken — die Engine berechnet die Referenz nur einmal, Batch-Verarbeitung gegen einen Master ist schnell.

TARGET
TARGET — Farb-Match — ein Foto in der Stimmung eines anderen einfärben
REFERENCE
REFERENCE — Farb-Match — ein Foto in der Stimmung eines anderen einfärben
Target → reference look
Target → reference look — Farb-Match — ein Foto in der Stimmung eines anderen einfärben
JavaScript
// Color transfer — match a target's tones to a reference (Reinhard, log-LMS)
// demo_color_transfer.js
//!INPUT: TARGET, REFERENCE
//!OUTPUT: OUTPUT

// Reinhard (2001) color transfer in log-LMS space — perceptually
// well-behaved tone matching. The TARGET image's per-channel mean
// and standard deviation are shifted to match the REFERENCE's. Works
// great for harmonising photos shot under different lighting,
// matching screenshot palettes across OS themes, or reviving washed-
// out legacy material to fit a modern hero shot.
//
// Pipeline:
//   1. Engine.colorStats(reference) — compute reference stats once.
//   2. target.colorTransfer(stats)   — shift target to match.
//
// The colorStats() / colorTransfer() split lets you batch one
// reference against many targets without recomputing reference
// stats on every call.

const target = Engine.loadImage(TARGET);
const ref    = Engine.loadImage(REFERENCE);

const stats = Engine.colorStats(ref);
console.log(`reference log-LMS mean: [${stats.mean.map(v => v.toFixed(3)).join(', ')}]`);
console.log(`reference log-LMS std:  [${stats.std.map(v => v.toFixed(3)).join(', ')}]`);

target.colorTransfer(stats).save(OUTPUT);

ref.free();
target.free();

// © 2026 Michael Lechner · mlc OpticScript · https://mlcgo.eu · Elastic License 2.0