Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
adrhill opened this issue Dec 27, 2023 · 0 comments
Open

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

adrhill opened this issue Dec 27, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@adrhill
Copy link
Collaborator

adrhill commented Dec 27, 2023

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.

@adrhill adrhill self-assigned this Dec 27, 2023
@adrhill adrhill added the enhancement New feature or request label Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant