gray op• Data kinds: image → image
• Call: fullseye.apply(img, "quantize_uniform", 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_uniform: knob a sweep (docs site)
*Knob b does not change the output (measured: identical at 0.1 / 0.5 / 0.9).*
On other images (synthetic scene / photo / coins. Top row: inputs, bottom row: their outputs. Knobs at default):
▸ quantize_uniform: 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.
一様量子化器(丸め)。`a がビット数 1〜8、b` は未使用。
`round(x * (L-1)) / (L-1)、L = 2**bits。刻みは Δ = 1/(L-1)`。
**`xpil_posterize` との違いはここで、無視できない**: あちらは PIL の実装で
下位ビットを切り捨てるので、出力の平均が入力より `Δ/2` だけ低い。
一様分布の入力で実測すると、bits=4 で平均誤差 `-0.0312(理論 -Δ/2 = -0.03125`)。
分散はどちらも `Δ²/12` で同じだが、偏りがある分だけ二乗誤差が
切り捨て: Δ²/12 + (Δ/2)² = Δ²/3 丸め: Δ²/12
と 4 倍ちがう。明るさを測る前段に置くなら丸めでなければならない。
適用条件と誤差(閉形式): 入力が刻みに対して十分ばらついている(量子化雑音が
入力と無相関とみなせる)とき、誤差は `[-Δ/2, +Δ/2]` の一様分布で、平均 0・
分散 `Δ²/12`。この仮定が崩れるのは平坦部で、そこでは誤差が信号と相関して
縞(バンディング)になる —— 誤差を雑音として扱いたいなら `dither_ordered` か
`dither_floyd_steinberg を通すこと。段差が見えているかは banding_map` で測れる。
• 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_uniform 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_lloyd_max · 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.