coloraide

A library to aid in using colors

MIT License

Downloads
15.8K
Stars
191
Committers
2

Bot releases are visible (Hide)

coloraide - 3.3.1 Latest Release

Published by facelessuser 6 months ago

3.3.1

  • FIX: Ray trace gamut mapping algorithm will better handle perceptual spaces like CAM16 and HCT which have
    atypical achromatic responses. This prevents unexpected cutoff close to white.
  • FIX: Fix some documentation examples regarding gamut mapping in HCT.
coloraide - 3.3

Published by facelessuser 6 months ago

3.3

  • NEW: Extend the Cylindrical mixin class to expose radial_name() and radial_index() on the color space to
    return the default name or default index of the radial coordinate in polar color spaces. It also exposes
    is_polar() as a simple check to see if the space uses polar coordinates.
  • NEW: Euclidean distance algorithm will now handle cylindrical color spaces by converting the polar coordinates
    to rectangular coordinates in order to return sensible results.
  • NEW: Allow specifying number of colors to return for monochromatic harmony. When fewer are specified, allow them
    to be spaced further apart for better contrast.
  • FIX: Handle unexpected undefined values in Euclidean distance.
coloraide - 3.2

Published by facelessuser 7 months ago

3.2

  • NEW: Add zcam-jmh color model.
  • NEW: Previously, color spaces such as cam16-jmh, cam16-ucs, jzczhz, etc. would handle achromatic values
    absolutely, based on XYZ with the specified white point which could result in values with non-zero chroma. Now they
    will be handled relative to the space, meaning colors will be considered achromatic when they are close to zero
    chroma. What is considered achromatic is affected by the adapting luminance and other environmental settings.
    This simplifies logic making it faster and also easier for users to subclass with their own environmental settings.
  • NEW: Normalize how color spaces with special viewing conditions are configured. Document configuring viewing
    conditions of color models where applicable.
  • NEW: Add new space parameter in cam16 ∆E method to replace the now deprecate model parameter. space is
    more flexible as users can now create CAM16 UCS spaces with different lighting environments and specify them
    instead.
  • NEW: Remove previously deprecated CAM16 Jab implementation. Use cam16-ucs instead.
  • NEW: Interpolation will now gracefully handle a list of a single color causing the interpolation to just return
    the single color.
  • NEW: More helpful interpolation errors will raise for an empty list.
  • NEW: Generic ray trace gamut mapping now has a new pspace parameter that can be used to specify a perceptual
    space in either LCh-ish or Lab-ish form. lch parameter is now deprecated, but currently still present, but
    pspace will take priority if both are defined.
  • NEW: Rename algebra.npow to algebra.spow (signed power). algebra.npow is now deprecated and will be
    removed at some future time.
  • FIX: Don't force space to clamp negative XYZ when they are absolutizing them in some spaces.
  • FIX: Ensure ST2084 EOTF implements the max step as specified in the spec.
coloraide - 3.1.2

Published by facelessuser 7 months ago

3.1.2

  • ENHANCE: Further improvements to both speed and accuracy of ray trace gamut mapping.
  • FIX: Handle gamut mapping HDR spaces via ray trace more sanely.
coloraide - 3.1.1

Published by facelessuser 8 months ago

3.1.1

  • ENHANCE: Improved performance of ray tracing gamut mapping algorithm.
  • FIX: Fix corner cases for detecting ray trace hits on gamut.
coloraide - 3.1

Published by facelessuser 8 months ago

3.1

  • NEW: Increase accuracy of the experimental ray tracing gamut mapping algorithm.
  • NEW: Add generic gamut mapping algorithm that employs ray tracing method that can be used with any LCh
    perceptual space.
  • NEW: Ray tracing gamut mapping algorithm parameter traces will no longer do anything as the approach no longer
    has variable passes after new accuracy enhancements.
  • FIX: Jzazbz bug was fixed that would result in a divide by zero failure.
coloraide - 3.0.1

Published by facelessuser 8 months ago

3.0.1

  • FIX: Don't cache coercion of non-RGB space to RGB space in ray tracing gamut mapping algorithm as the underlying
    color object could change underneath.
coloraide - 3.0

Published by facelessuser 8 months ago

3.0

  • BREAK: The CSS HDR spec now defines the polar spaces such as JzCzhz color() with hue channels that support
    traditional hue syntax instead of percentages. Updated all polar spaces that are represented in the color() format
    to support this change. This is likely low impact as using percentages for hues is fairly uncommon.
  • BREAK: Remove previously deprecated functions: algebra.apply, algebra.no_nans, algebra.no_nan,
    algebra.is_nan, Labish.labish_names, Labish.labish_indexes, LChish.lchish_names, and
    LCHish.lchish_indexes. These were mainly used internally, so breakage is likely low.
  • NEW: jzazbz, jzczhz, ictcp, rec2100-pq, and rec2100-hlg are now formally recognized, and by default
    serialized, without the -- prefix as all the spaces are now part of the official HDR specification in CSS.
    Previously, the spec was unofficial. -- prefixed names will still be recognized, but at some future time --
    support will be removed for these spaces. Additionally, these spaces are now registered by default.
  • NEW: ∆E methods z and itp are now registered by default as their associated color spaces are now registered
    by default as well.
  • NEW: Color space channel flags FLG_PERCENT and FLG_OPT_PERCENT are deprecated and no longer used. They are
    still present, but will be removed in the future.
  • NEW: Update CSS percentage input/output ranges for jzazbz, jzczhz, and ictcp to match the CSS HDR spec.
  • NEW: Ray tracing gamut mapping algorithms have been added: oklch-raytrace and lch-raytrace.
  • NEW: RGB spaces now expose a linear() function on the underlying class to specify if they have a linear
    equivalent.
  • NEW: Adjust inheritance order of RGB spaces. Previously, many inherited from sRGB, now they inherit from
    sRGBLinear.
  • NEW: Add rec2100-linear, essentially and alias for rec2020-linear, that is specified in the CSS HDR
    specification.
  • FIX: Ensure that when using discrete interpolation that spline based interpolations are truly discrete.
coloraide - 2.16

Published by facelessuser 10 months ago

2.16

  • NEW: Gamut mapping plugins now must accept a space parameter and the color will not already be in the desired
    gamut color space. This change was specifically made in order to fix a bug with HCT gamut mapping.
  • FIX: Fix corner cases in HCT gamut mapping that would struggle with colors with high chroma and low lightness.
coloraide - 2.15.1

Published by facelessuser 10 months ago

2.15.1

  • FIX: Small regression related to indirectly gamut mapping in another space other than its own.
coloraide - 2.15

Published by facelessuser 10 months ago

2.15

  • BREAK: ∆E HCT used an extremely small JND by default to yield tonal palettes that were comparable to Google's
    Material. This was not inline with other gamut mapping function defaults. The default is now a more appropriate
    value of 2. Users that relied on ∆E HCT to help generate tonal pallets with HCT should now use the jnd parameter
    to set the JND to 0.02 in order to generate tonal pallets more like Google.
  • NEW: fit() now accepts a jnd option to control the JND limit when gamut mapping with lch-chroma,
    oklch-chroma, and hct-chroma.
  • NEW: to_string() can now accept a dictionary of arguments to control gamut mapping via the fit argument.
  • FIX: Update lch-chroma epsilon to be consistent with other gamut mapping plugin conventions.
coloraide - 2.14.1

Published by facelessuser 10 months ago

2.14.1

  • FIX: More precision for HCT conversion for better round trip conversions.
coloraide - 2.14

Published by facelessuser 10 months ago

2.14

  • NEW: normalize() will now also normalize a cylindrical color model with negative chroma/saturation to its
    positive chroma/saturation form, assuming one exists.
  • NEW: Gamut clipping is performed on a cylindrical color's normalized form ensuring that a color which is in
    gamut but has a negative chroma/saturation will be mapped more correctly.
  • NEW: Do not clamp user input of lightness and chroma in various spaces. Clamping will only occur during
    conversion if the algorithm requires it.
  • NEW: Channels can be accessed by get and set using their numerical value (as a string input).
  • NEW: Color space plugins that specify the gamut space via GAMUT_CHECK must use that color space as a
    reference when when gamut mapping or clipping by default.
  • NEW: New color space plugin attribute CLIP_SPACE added which will override the space specified by
    GAMUT_CHECK to force clipping in the origin space even if a gamut mapping space is defined. This is only used when
    it is advantageous to clip in the origin space, e.g. when faster and still practical.
  • NEW: Deprecate non-standard CAM16 (Jab) space. People should use the standard CAM16 JMh or the CAM16 UCS, SCD,
    or LCD Jab spaces. The non-standard Jab is still available via coloraide.spaces.cam16.CAM16, but it is no longer
    available in coloraide.everything and will be removed at a future time.
  • NEW: Add new channel aliases: j for jz in Jzazbz and JzCzhz. Also add c for cz and h for hz in
    JzCzhz.
  • NEW: HSL will now always return positive saturation for wide gamut colors via its conversion.
  • FIX: Fix a an issue with the CAM16 model's transformation that prevented good round trip with negative
    lightness.
  • FIX: Ensure that when harmony auto creates a cylindrical space from a rectangular space that it checks
    achromatic status in the original color space.
  • FIX: ∆E HCT should use colorfulness, not chroma, in the calculation.
  • FIX: Don't return scientific notation when serializing colors.
  • FIX: Small fix for Rec. 2100 PQ conversion algorithm.
  • FIX: The oRGB color space should be gamut mapped in srgb as it is a transform of the sRGB space.
  • FIX: Because Okhsl and Okhsv have a rough sRGB approximation and not precise, they are instead gamut mapped to
    their own gamut by default.
  • FIX: Much more accurate ICtCp matrices.
  • FIX: Fix typing of deeply nested arrays in algebra.
  • FIX: Fix issue with HCT undefined channel resolver.
  • FIX: Proper handling of negative lightness for DIN99o.
  • FIX: Circular mean should return positive values.
coloraide - 2.13.1

Published by facelessuser 11 months ago

2.13.1

  • FIX: Minor typing regressions and fixes.
coloraide - 2.13

Published by facelessuser 11 months ago

2.13

  • NEW: Performance related enhancements in high traffic calculations.
  • NEW: Use matmul instead of dot in calculations to not confuse math savvy people.
  • FIX: Some typing fixes/improvements.
  • FIX: Minor fixes to algebra library.
coloraide - 2.12

Published by facelessuser 12 months ago

2.12

  • NEW: When serializing, percent can now take a sequence of booleans to indicate which channels are desired to
    be represented as a percentage, alpha included.
  • NEW: color() serializing now supports string output with percent.
  • FIX: When serializing, the alpha channel is no longer handled special with a minimum value of 5. Precision is
    equally applied to all channels.
coloraide - 2.11

Published by facelessuser about 1 year ago

2.11

  • NEW: Add new css-linear interpolator that provides compatibility with the CSS specification. This deviates
    from the default linear interpolator in how undefined hues are resolved for interpolation, particularly noticeable
    with longer hue resolution.
  • NEW: Add new INTERPOLATOR class option to change the default interpolator that is used.
coloraide - 2.10

Published by facelessuser about 1 year ago

2.10

  • NEW: Declare official support for Python 3.12.
  • NEW: Color.steps and Color.discrete now accept delta_e_args to allow configuring the underlying distance
    algorithm when using the delta_e option.
  • NEW: CIE Lab, both D50 and D65, are now derived from a CIELab class. CIE LCh, both D50 and D65, are also
    now derived from a CIELCh class. This makes it easy to determine a CIE Lab or CIE LCh space from other Lab-like
    spaces.
  • NEW: ∆E^*^76, ∆E^*^94, ∆E^*^00, and ∆E^*^cmc all accept a new parameter called space which allows
    the user to specify a registered Lab color space name (one that is derived from the CIELab class) to use as the
    distancing color space. This allows a user to use D50 Lab (or any other variant) for distancing if required.
  • FIX: For consistency, ∆E^*^94 and ∆E^*^cmc now use Lab D65 by default just like ∆E^*^76 and
    ∆E^*^00. This fixes an issue where the docs indicated that they use D65, but in actuality they were using D50.
coloraide - 2.9.1.post1

Published by facelessuser about 1 year ago

2.9.1.post1

  • FIX: Fix incorrect changelog mention of recent fix being for HSL instead of HWB.
coloraide - 2.9.1

Published by facelessuser about 1 year ago

2.9.1

  • FIX: Average should allow controlling powerless be disabled by default for backwards compatibility.
  • FIX: HWB should use the algorithm defined in CSS that allows for round tripping even in the negative lightness
    direction. Previously we were converting directly from HSV.
Package Rankings
Top 6.23% on Pypi.org
Top 43.41% on Conda-forge.org
Badges
Extracted from project README
Donate via PayPal Build Coverage Status PyPI Version PyPI Downloads PyPI - Python Version