fullseye

dither — GFX2D post op

使い方

Quantise to levels values per channel while preserving the local mean.

method:

Which method preserves the mean better depends on the image, and this docstring will not pretend otherwise. Measured on a 128-step horizontal ramp: ordered is exact (0.0) at 2, 3 and 4 levels and drifts to 1.1e-3 at 8 levels, while Floyd-Steinberg is 7.3e-4 at 2 levels and improves to 4.1e-5 at 16. Ordered wins where the level lattice divides the ramp, error diffusion wins where it does not.

Accepts (H, W) or (H, W, 3|4); an alpha channel is quantised too, because a dithered sprite with a smooth alpha is exactly the case that motivates this.

Output values lie on the lattice k / (levels - 1).

参考(サンプルデータ・文献)

実行できる例(この op を実際に呼ぶ検証済みサンプル)

型が繋がる次の op(image2d を入力に取れる)

shadow_cast_2d

同カテゴリ(post)

bloom · vignette · chromatic_aberration · film_grain · color_lut · color_grade · palette_quantize


Provenance: gfx2d.py — GFX2D operator registry. この per-op ノートは tools/opdocs.py md が自動生成(手編集しない)。

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