colour-science / colour

Colour Science for Python
https://www.colour-science.org
BSD 3-Clause "New" or "Revised" License
2.12k stars 262 forks source link

How to plot "Adobe RGB (1998)" color gamut? #576

Closed hminle closed 4 years ago

hminle commented 4 years ago

Hi,

I cannot draw Adobe RGB 1998 gamut using this command:

colour.plotting.plot_RGB_colourspaces_in_chromaticity_diagram_CIE1931(
    colourspaces=["Adobe RGB (1998)"], 
    standalone=False, title=None)

image

For other colour spaces, it's normal, but not this one. Why is that?

Thanks

sobotka commented 4 years ago

Definitely seems like a bug on the string, as the following works:

colour.plotting.plot_RGB_colourspaces_in_chromaticity_diagram_CIE1931(colourspaces=colour.models.ADOBE_RGB_1998_COLOURSPACE)

KelSolaar commented 4 years ago

Hi @hminle,

It is because the mapping is filtered with a Regex pattern: https://github.com/colour-science/colour/blob/b9ebce4be127aea9a282696dc5ac7e162c68c5c4/colour/plotting/common.py#L687

So you would need to escape the parenthesis.

KelSolaar commented 4 years ago

That being said we could improve the docs a bit here!

hminle commented 4 years ago

colour.models.ADOBE_RGB_1998_COLOURSPACE

Thanks, this way works for me It's quite weird though

colour.plotting.plot_RGB_colourspaces_in_chromaticity_diagram_CIE1931(
    colourspaces=['ProPhoto RGB', 'Display P3', colour.models.ADOBE_RGB_1998_COLOURSPACE, 'sRGB'], 
    standalone=False, title=None, colour_cycle_map=cm)
KelSolaar commented 4 years ago

Yeah this is supported so that you can both filter existing RGB Colourspaces while passing a custom one you have just built!

I do it here for example with the Venice colourspaces: https://colab.research.google.com/drive/1ZGTij7jT8eZRMPUkyWlv_x5ix5Q5twMB

hminle commented 4 years ago

Yeah this is supported so that you can both filter existing RGB Colourspaces while passing a custom one you have just built!

I do it here for example with the Venice colourspaces: https://colab.research.google.com/drive/1ZGTij7jT8eZRMPUkyWlv_x5ix5Q5twMB

Thanks, Just curious. In your Venice experiment, I see its colour gamut goes outside visible range a lot. So what's the point to make such a colour space like that?

KelSolaar commented 4 years ago

It not that the colourspace is designed to have such primaries in the first place, it is more a direct consequence of fitting the camera data to the CIE 1931 2 Degree Standard Observer: if you compute the by-product primaries from the 3x3 matrix mapping the former to the latter, you might get some that goes way beyond the spectral locus. This is actually quite typical from cameras because they are not really colorimetric.