Skip to content

Commit

Permalink
Rename MINDE class attribute from LIMIT to JND for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
facelessuser committed Aug 25, 2024
1 parent 9a84425 commit 9301e91
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion coloraide/gamut/fit_hct_chroma.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ class HCTChroma(MINDEChroma):
"""HCT chroma gamut mapping class."""

NAME = "hct-chroma"
LIMIT = 2.0
JND = 2.0
DE_OPTIONS = {"method": "hct"}
PSPACE = "hct"
2 changes: 1 addition & 1 deletion coloraide/gamut/fit_lch_chroma.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ class LChChroma(MINDEChroma):
"""LCh chroma gamut mapping class."""

NAME = "lch-chroma"
LIMIT = 2.0
JND = 2.0
DE_OPTIONS = {'method': '2000', 'space': 'lab-d65'}
PSPACE = "lch-d65"
4 changes: 2 additions & 2 deletions coloraide/gamut/fit_minde_chroma.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class MINDEChroma(Fit):
"""

NAME = "minde-chroma"
LIMIT = 0.02
JND = 0.02
DE_OPTIONS = {"method": "ok"} # type: dict[str, Any]
PSPACE = "oklch"
MIN_CONVERGENCE = 0.0001
Expand Down Expand Up @@ -73,7 +73,7 @@ def fit(
lightness = mapcolor[l]
sdr = gamutcolor._space.DYNAMIC_RANGE == 'sdr'
if jnd is None:
jnd = self.LIMIT
jnd = self.JND
epsilon = calc_epsilon(jnd)

if de_options is None:
Expand Down
16 changes: 9 additions & 7 deletions docs/src/markdown/about/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,22 @@
- **NEW**: Define HTML output representation for Jupyter via `_repr_html_`.
- **NEW**: Remove deprecated `model` parameter from `cam16` ∆E method. Space should be used instead.
- **NEW**: Remove deprecated `algebra.npow` function. `algebra.spow` should be used instead.
- **NEW**: New generic `minde-chroma` gamut mapping method that allows specifying any perceptual space to operate in.
`oklch-chroma`, `lch-chroma`, and `hct-chroma` are now derived from `minde-chroma` and just default to using the
- **NEW**: New generic `minde-chroma` gamut mapping method that allows specifying any Lab-ish or LCh-ish to operate
in. `oklch-chroma`, `lch-chroma`, and `hct-chroma` are now derived from `minde-chroma` and just default to using the
specified color space to provide backwards compatibility. `minde-chroma` defaults to using OkLCh by default.
- **NEW**: All MINDE chroma reduction methods now skip distance checks if a JND of zero is specified. A JND of zero
essentially disables the MINDE behavior and will reduce chroma as close to the gamut boundary as possible faster
than it would previously.
- **NEW**: MINDE chroma reduction plugins now dynamically figures out lightness range instead of requiring it to be
specified as a class attribute.
- **NEW**: MINDE chroma reduction gamut mapping and ray trace gamut mapping now allow for specifying an `adaptive`
option which will bias the chroma reduction by the specified factor in a hue independent way relative to a midpoint
of L = 50%.
- **NEW**: MINDE chroma reduction plugins now dynamically figure out lightness range instead of requiring it to be
specified as a class attribute.
- **BREAK**: MINDE chroma reductions combines the `DE` class attribute and the `DE_OPTIONS` under `DE_OPTIONS`.
specified. Users who have a derived gamut mapping class, these must now be combined under `DE_OPTIONS`.
- **BREAK**: MINDE chroma reduction plugins specify the perceptual space via the `PSPACE` attribute instead of `SPACE`.
- **BREAK**: MINDE chroma reductions plugin combines the `DE` and `DE_OPTIONS` class attributes under `DE_OPTIONS`.
Users who have a derived gamut mapping class must combined these two options under `DE_OPTIONS`.
- **BREAK**: MINDE chroma reduction plugin now specifies the perceptual space via the `PSPACE` attribute instead of
`SPACE`. Users who have a derived, personal gamut mapping plugin need to update the name accordingly.
- **BREAK**: MINDE chroma reduction plugins now specify the JND under the `JND` class attribute instead of `LIMIT`.
Users who have a derived, personal gamut mapping plugin need to update the name accordingly.
- **BREAK**: Finalize the `raytrace` gamut mapping algorithm implementation and remove experimental label.

Expand Down
12 changes: 6 additions & 6 deletions docs/src/markdown/gamut.md
Original file line number Diff line number Diff line change
Expand Up @@ -450,11 +450,11 @@ Please see [Ray Tracing Chroma Reduction in Any Perceptual Space](#ray-tracing-c
to learn how to use different perceptual spaces and how to set your own default.
///

ColorAide has developed an experimental chroma reduction technique that employs ray tracing. Its aim is to provide
faster chrome reduction for gamut mapping using constant lightness. This approach specifically targets RGB gamuts, or
spaces that can be represented with RGB gamuts. Additionally, if ColorAide can detect a linear version of the targeted
RGB gamut, that version will be used automatically for best results. Currently ColorAide can gamut map all officially
supported color spaces as they either have an RGB gamut or can be coerced into one.
ColorAide has developed a chroma reduction technique that employs ray tracing. Its aim is to provide faster chrome
reduction for gamut mapping using constant lightness. This approach specifically targets RGB gamuts, or spaces that can
be represented with RGB gamuts. Additionally, if ColorAide can detect a linear version of the targeted RGB gamut, that
version will be used automatically for best results. Currently ColorAide can gamut map all officially supported color
spaces as they either have an RGB gamut or can be coerced into one.

The ray trace approach works by taking a given color and converting it to a perceptual Lab-ish or LCh-ish color space
(the default being OkLCh) and then calculates the achromatic version of the color (chroma set to zero). Assuming the
Expand Down Expand Up @@ -652,7 +652,7 @@ class HCTChroma(MINDEChroma):
"""HCT chroma gamut mapping class."""

NAME = "hct-chroma"
LIMIT = 2.0
JND = 2.0
DE_OPTIONS = {"method": "hct"}
PSPACE = "hct"

Expand Down

0 comments on commit 9301e91

Please sign in to comment.