color_transfer — COLORTRANSPORT matching op

Data kinds: rgbimage × rgbimagergbimage

Call: import colortransport; colortransport.color_transfer(src, ref, method='reinhard', space='lab') (or opscolortransport.get("color_transfer"))

Usage

Move the colour cast of `src toward ref`.

> The detailed description below is the original text — the summary and the headings are translated.

Parameters

----------

src, ref : array_like

`(..., 3) の sRGB([0, 1]` の float、または整数 dtype)。

大きさは違ってよい(統計だけを使う)。

method : {"reinhard", "gaussian", "histogram"}

• `"reinhard"` —— 各チャネルの平均と標準偏差だけ合わせる

(Reinhard, Ashikhmin, Gooch & Shirley, IEEE CG&A 21(5), 2001)。

各チャネルが単峰の正規分布という仮定が効いている。

前景と背景がはっきり分かれた 二峰の絵では、平均と分散は合うのに

どちらの峰にも当たらない色になる(例外は出ない)。

• `"gaussian"` —— 共分散ごと運ぶ Monge 写像。相関が保たれる

• `"histogram"` —— チャネルごとに厳密なヒストグラム整合。

周辺分布は完全に一致するが、チャネル間の相関は壊れる

space : {"lab", "rgb"}

統計を取る空間。既定の `lab は :mod:imgmetrics` の実体を使う。

Returns

-------

ndarray

`src と同じ形の sRGB [0, 1]`(色域外は切り詰められる)。

Background guides (the physics and conventions behind this op)

colorimetry — 測色と分光の知識 — 色は「分光 × 光源 × 観測者」でしか決まらない

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

color_transportpy -3.11 examples/color_transport.py

Ops the type connects to (they accept rgbimage as input)

Same category (matching)

histogram_match · gaussian_transport_map


*Provenance: colortransport.py — COLORTRANSPORT operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.