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

Cusp finding algorithm choice needed #22

Open
KevinJW opened this issue Mar 1, 2023 · 5 comments
Open

Cusp finding algorithm choice needed #22

KevinJW opened this issue Mar 1, 2023 · 5 comments
Labels
Colour Issues that relate to colour 'bugs' or failure

Comments

@KevinJW
Copy link
Collaborator

KevinJW commented Mar 1, 2023

Nick mentioned the DCTL version of the cusp finding is different to the blink implementation and Pekka mentioned that he believes a functional version should be possible.

DCTL uses h based on even spacing in JMh
Blink uses a spacing based on the display/mastering gamut

We should select one

@KevinJW KevinJW added the Colour Issues that relate to colour 'bugs' or failure label Mar 1, 2023
@KevinJW
Copy link
Collaborator Author

KevinJW commented Mar 1, 2023

My thought is we should base it on JMh as this is independent on the display gamut if possible.

@nick-shaw
Copy link
Collaborator

The cusp is of course the cusp of the display (or limit) gamut, so it is not independent of that. But an evenly spaced LUT in JMh (as my DCTL uses) makes for an easier look-up than an unevenly spaced one. The uneven spacing requires an iteration to find the two table entries to lerp between.

@KevinJW
Copy link
Collaborator Author

KevinJW commented Mar 2, 2023 via email

@alexfry
Copy link
Collaborator

alexfry commented Mar 2, 2023

Perhaps we use the inverse method to create a high resolution temp 1D LUT, maybe 4096 entries in the target gamut's H (HSV) space, then resample that down to a smaller 1D LUT in the h (JMh) space. That makes the per pixel lookup nice and fast, and keeps the preparation simple and accurate.

@nick-shaw
Copy link
Collaborator

nick-shaw commented May 23, 2024

Adding a note that we (so far) kept the uneven JMh spacing for cusp lookups because that means there are entries at precisely the hues of the primary and secondary 'points' of the gamut. While a single, evenly spaced lookup for all cusps and gamma values might be faster (at the expense of a longer oversample and then down-sample init() process) a table with more than 360 entries would be needed to be sure we had values at least close to the 'points'.

Note: The start of this thread said the DCTL used a different approach. This is no longer the case, and the DCTL now uses the same tables as the Blink, but pre-calculated in Python.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Colour Issues that relate to colour 'bugs' or failure
Projects
None yet
Development

No branches or pull requests

3 participants