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

Audit function parameter and return types (3/2) #1

Closed
wants to merge 12 commits into from

Conversation

jgerigmeyer
Copy link

@jgerigmeyer jgerigmeyer commented Feb 28, 2024

Follow-up suggestions based on color-js#457:

  • Adjusts src and types so that Color.set(), Color.setAll(), and Color.toGamut() consistently return Color objects.
  • Uses getColor for space.from and space.to

lloydk and others added 8 commits February 26, 2024 21:32
Ensure that functions in the following modules have the correct types
and ensure that all color types can be passed as parameters:

- chromaticity
- distance
- get
- getAll
Drop "backing off" on chroma and instead:

- ray trace to cube surface and correct L & H
- ray trace again to see if the point moved off the surface, and if so,
  reposition it back on the surface and correct L & H one more time.
- We may now be undersaturated due to L & H correction, so extend the
  vector past the cube surface and find the intersection.

This is our gamut mapped color, no clipping should be needed.
Ensure that functions in the following modules have the correct types
and ensure that all color types can be passed as parameters:

- chromaticity
- distance
- get
- getAll
* Add edge seeker algorithm

* add hue normalization
This is probably as far as we can take ray tracing.

It was though that the last correction and clip could be omitted, but
it is required to get the optimal deltas. This time confirmed with
a script. Max deltas: ∆L = 0.011682128741787201 ∆h = -4.212684767726387

Previously, there was still a region (in yellow) that could exceed this.
(before ∆L = 0.0011833203080477972 ∆h = -8.31632698148956).
@jgerigmeyer
Copy link
Author

@MysteryBlokHed I'd love your thoughts on these changes as well.

jgerigmeyer and others added 4 commits February 28, 2024 14:47
* audit-types-1:
  Audit function parameter and return types (1/2)
Ensure that functions in the following modules have the correct types
and ensure that all color types can be passed as parameters:

- inGamut
- luminance
- set
- setAll
- space
- toGamut
* main:
  Audit function parameter and return types (2/2) (#457)
  Always show delta display to help confirm it is in gamut (#458)
  Final clip is required in Ray tracing
  [apps/gamut-mapping] Add edge seeker algorithm (#448)
  Audit function parameter and return types (1/2) (#456)
  Rework raytracing limiting hue shift to no more than 3 degrees at worst
@jgerigmeyer
Copy link
Author

Replaced by color-js#461

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants