enum

PNGGIF::Raster::Dither

Inherits Enum < Comparable < Value < Object

How an image's colors are dithered when reduced to a smaller palette than the source.

Dithering trades spatial resolution for perceived color depth: instead of snapping each pixel to its nearest palette entry (which bands gradients), it scatters the two nearest entries so the eye averages them back to the in-between color.

Constants

None = 0
Ordered = 1
Diffusion = 2
Auto = 3

Instance methods

auto?

Returns true if this enum value equals Auto

Source
diffusion?

Returns true if this enum value equals Diffusion

Source
none?

Returns true if this enum value equals None

Source
ordered?

Returns true if this enum value equals Ordered

Source
resolve(animated : Bool) : Dither

Collapses Auto to a concrete method: error diffusion looks best on a still, but its irregular stipple shimmers across frames, so an animated source falls back to the frame-stable ordered dither.

Source