Skip to content

Refactor internals to use lower-precision fixed point numbers #100

@adrhill

Description

@adrhill

Addresses #70.

Currently, when passed an input image of eltype Colorant{T}, the dithered output image is computed using the floating point number type T provided by the user.

Since the goal of dithering is image quantization, it would be reasonable to exclusively use quantized N0f8 fixed-point numbers from FixedPointNumbers.jl internally.

This would also enable the optional use of a look-up table of closest colors. Currently, the performance bottleneck of most dithering algorithms is a large amount of calls to colordiff from Colors.jl. For color palettes of size $n$, this function is called at least $n$ times on each pixel. For an upfront cost of $256^3 \cdot n$ calls to colordiff, a N0f8 look-up table could be computed instead. This would open up DitherPunk for dithering of live-video.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions