gray op• Data kinds: image → image
• Call: fullseye.apply(img, "quantize_lloyd_max", a=0.5, b=0.5) (the 2-D model is one image plus two scalar knobs a,b∈[0,1])

*The figure is the actual output on a synthetic 128×128 input. Left: input, right: output. Point clouds are drawn as a top-down scatter (brightness = z), 1-D series as a line plot, volumes as the maximum-intensity projection along z, videos as the middle frame, complex images as magnitude; return values that are not pictures are shown as the values themselves.*
Sweeping knob a (0.1 / 0.5 / 0.9, the other knob at its default):
▸ quantize_lloyd_max: knob a sweep (docs site)
Sweeping knob b (0.1 / 0.5 / 0.9, the other knob at its default):
▸ quantize_lloyd_max: knob b sweep (docs site)
On other images (synthetic scene / photo / coins. Top row: inputs, bottom row: their outputs. Knobs at default):
▸ quantize_lloyd_max: other inputs (docs site)
*The 4th column is a colour (H,W,3) input. This op handles colour without crossing channels (it does not convolve the colour channel as a third spatial axis).*
> This operator's description has not been translated yet. The original text follows as it is.
入力の分布に合わせた最適な量子化(Lloyd–Max、1-D の k-means)。
`a が段数のビット数 1〜8、b` は反復回数(1〜20)。一様量子化が刻みを等間隔に
置くのに対し、こちらは画素値が混んでいる所に刻みを細かく置く。代表値は各区間の
重心、区間の境は隣り合う代表値の中点 —— この 2 つを交互に当てるのが Lloyd の反復で、
二乗誤差は単調に減る(増えることはない)。
一様量子化との差が出る条件: 入力のヒストグラムが偏っているとき。一様分布を
入れると一様量子化と一致するので、差が出ないこと自体が正しさの確認になる。
暗部に画素が集中した画像(影の多い検査画像、蛍光像)では同じビット数で誤差が下がる。
適用条件: (1) 出力は入力に依存した代表値の集合なので、画像ごとに符号表が違う
—— 別の画像と画素値を直接比べられない(比べたいなら一様量子化)。(2) 空いた区間は
そのまま残る(代表値が動かない)。(3) 反復は局所解に落ちうるが、1-D では初期値を
分位点に取れば実用上安定する。
• gallery2d_gray_arith family guide
• 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.
The program below has been verified to run (same input as the figure). In Studio's help this block becomes buttons that load and run it on the spot.
quantize_lloyd_max 0.50 0.50
▸ Load this pipeline · Load & run
• gallery2d_gray_arith — py -3.11 examples/gallery2d_gray_arith.py
image as input)identity · gaussian · mean_box · bilateral · unsharp · median · min_filter · max_filter
gray)gamma · quantize_uniform · quantization_error · dither_ordered · dither_floyd_steinberg · companding_mu_law · banding_map · invert
*Provenance: ops.py — 2D 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.