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

Some ordered dither threshold matrices are improperly treated #103

Closed
LukeTrainor opened this issue Jul 8, 2024 · 1 comment · Fixed by #104
Closed

Some ordered dither threshold matrices are improperly treated #103

LukeTrainor opened this issue Jul 8, 2024 · 1 comment · Fixed by #104
Labels
bug Something isn't working

Comments

@LukeTrainor
Copy link

In ordered.jl the threshold matrix is converted into indices by mat = numerator.(alg.mat). If the denominator is not prime, however, the input threshold matrix will have some of its fractions simplified.

The simplest example I can find is IM_h4x4a(). The threshold matrix is

const H4X4A = [
    4 2 7 5
    3 1 8 6
    7 5 4 2
    8 6 3 1
]//9

but the result of numerator.(H4X4A) is

4×4 Matrix{Int64}:
 4  2  7  5
 1  1  8  2
 7  5  4  2
 8  2  1  1

A simple fix would be mat = numerator.(maximum(denominator.(alg.mat))*alg.mat), but there might be something more elegant.

@adrhill
Copy link
Collaborator

adrhill commented Jul 9, 2024

Nice catch, thanks a lot for reporting it!

@adrhill adrhill added the bug Something isn't working label Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants