Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

HSLuv color space #134

danburzo started this conversation in Ideas
Apr 8, 2018 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

Replies: 2 comments 1 reply

Comment options

yes! :D

You must be logged in to vote
0 replies
Comment options

danburzo
Feb 28, 2023
Maintainer Author

So the interesting thing about HSLuv (and the related HPLuv) is that it takes advantage of the fact that RGB gamuts in CIELUV space are polygons. Below is sRGB (colored), P3 (magenta) and Rec2020 (cyan):

The gamuts of sRGB, Display P3 and Rec 2020 are shown as nested trapezoids in CIELUV color space

This makes it computationally easy to find the maximum Chroma for the given Hue and Lightness, and HSLuv is defined as:

  • h = lchuv.h
  • l = lchuv.l
  • s = lerp(0, maxChroma(gamutLines, l, h), lchuv.c)

In Turn, HPLuv aims to capture the circle circumscribed in the gamut for a given lightness as the range for Chroma:

  • h = lchuv.h
  • l = lchuv.l
  • p = lerp(0, maxCommonChroma(gamutLines, l), lchuv.c)

The original color spaces were defined in relationship to sRGB, but given the expansion of CSS to other, wider RGB spaces, it would be interesting to have a HSLuv-type space for each. All that differs between RGB spaces is their pre-computed gamut lines.

Given srgb, display-p3, a98-rgb, rec2020, and prophoto-rgb on one hand, and hsluv and hpluv on the other, that produces 10 different possible color spaces. Hence I think this would work better as a separate project, eg. culori-hsluv, that can be plugged into Culori.

You must be logged in to vote
1 reply
Comment options

danburzo Feb 28, 2023
Maintainer Author

(Also the canonical HSLuv color space uses CIELUV under the D65 illuminat, while Culori uses the D50 illuminant.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
Help Welcome Extra attention is needed Color Space A color space that could be implemented
2 participants
Converted from issue

This discussion was converted from issue #48 on July 31, 2021 14:26.

AltStyle によって変換されたページ (->オリジナル) /