JuliaImages / DitherPunk.jl

Dithering algorithms in Julia.
MIT License
68 stars 3 forks source link

Add per-channel dithering #23

Closed adrhill closed 3 years ago

adrhill commented 3 years ago

Add a meta-method that takes any gray-scale dithering algorithm and applies channel-wise binary dithering to color images using channelview.

An illustration of this is shown here, where it is called "separate-space dithering".

The type AbstractColorDither will need be extended by AbstractCustomColorDither to differentiate this method from other methods like Floyd-Steinberg that take custom user-defined color palettes.

The output image will look different depending on the concrete color type on which channelview is applied. As RGB is typically used, this should be the default.

Pseudocode example:

alg = SeparateSpaceDither(Bayer(); colorspace=RGB)
dither!(img, alg)