-
-
Notifications
You must be signed in to change notification settings - Fork 253
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
[FEATURE]: Implement support for "slugified" colourspace names. #991
Comments
Here is a quick notebook to illustrate what we could do for example: https://colab.research.google.com/drive/1xlhqI0W71g7uX4HQ9pUiV13HqRsxWmny#scrollTo=2lbGErCPHmjM The main question is whether we want to support that by default or provide a way for people to implement that easily. Given that we use
It would be trivial to write camelCase, PascalCase, snake_case mappings from there. |
Thanks ! This looks great. Having it implemented straight into |
I think it would be preferable to stay close to Django here, they do encode URLs with that function which is actually one usage we could have. I was thinking that instead of doing (which works in my feature branch): >>> import colour
>>> colour.RGB_COLOURSPACES.lookup('alexa-wide-gamut')
RGB_Colourspace('ALEXA Wide Gamut',
[[ 0.684 , 0.313 ],
... We could directly implement that on It might be a bit magic though: >>> import colour
>>> colour.RGB_COLOURSPACES['ALEXA Wide Gamut'].name
'ALEXA Wide Gamut'
>>> colour.RGB_COLOURSPACES['alexa-wide-gamut'].name
'ALEXA Wide Gamut'
>>> list(colour.RGB_COLOURSPACES.keys())
['ACES2065-1', 'ACEScc', 'ACEScct', 'ACEScg', 'ACESproxy', 'ALEXA Wide Gamut', 'Adobe RGB (1998)', 'Adobe Wide Gamut RGB', 'Apple RGB', 'Best RGB', 'Beta RGB', 'Blackmagic Wide Gamut', 'CIE RGB', 'Cinema Gamut', 'ColorMatch RGB', 'DCDM XYZ', 'DCI-P3', 'DCI-P3+', 'DJI D-Gamut', 'DRAGONcolor', 'DRAGONcolor2', 'DaVinci Wide Gamut', 'Display P3', 'Don RGB 4', 'ECI RGB v2', 'ERIMM RGB', 'Ekta Space PS 5', 'F-Gamut', 'FilmLight E-Gamut', 'ITU-R BT.2020', 'ITU-R BT.470 - 525', 'ITU-R BT.470 - 625', 'ITU-R BT.709', 'Max RGB', 'N-Gamut', 'NTSC (1953)', 'NTSC (1987)', 'P3-D65', 'Pal/Secam', 'ProPhoto RGB', 'Protune Native', 'REDWideGamutRGB', 'REDcolor', 'REDcolor2', 'REDcolor3', 'REDcolor4', 'RIMM RGB', 'ROMM RGB', 'Russell RGB', 'S-Gamut', 'S-Gamut3', 'S-Gamut3.Cine', 'SMPTE 240M', 'SMPTE C', 'Sharp RGB', 'V-Gamut', 'Venice S-Gamut3', 'Venice S-Gamut3.Cine', 'Xtreme RGB', 'sRGB', 'aces', 'adobe1998', 'prophoto'] |
Yes very cool
…Sent from my iPhone
On 30 May 2022, at 11:59, Thomas Mansencal ***@***.***> wrote:
I think it would be preferable to stay close to Django here, they do encode URLs with that function which is actually one usage we could have.
I was thinking that instead of doing (which works in my feature branch):
>>> import colour
>>> colour.RGB_COLOURSPACES.lookup('alexa-wide-gamut')
RGB_Colourspace('ALEXA Wide Gamut',
[[ 0.684 , 0.313 ],
...
We could directly implement that on __getitem__, the first failure could be re-attempted against the slugified variant.
It might be a bit magic though!
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
|
>>> list(colour.RGB_COLOURSPACES.keys())
['ACES2065-1', 'ACEScc', 'ACEScct', 'ACEScg', ... True that it not very explicit what happening behind the scene. list(colour.RGB_COLOURSPACES.keys())
[("ACES2065-1", "aces", "aces2065-1"), ("ACEScc", "acescc"), ..., ("'Adobe RGB (1998)'", "adobe1998", "adobe-rgb-1998"), ...] But here we are getting into something complex to not break compatibility |
We cannot change |
What about
|
Description
Hello,
I'm looking to insert or retrieve
colour.RGB_COLORSPACES
names from file names.For example, I would like to use the
ALEXA Wide Gamut
colorspace into a file name which could be slugified to something likealexaWideGamut
. I could also run the invert where something likecolour.RGB_COLORSPACES.get("alexaWideGamut")
would return me theALEXA Wide Gamut
RGB_COLORSPACE
instance.This means colour could be an alternative method (to OCIO) to convert imagery files colorspaces, where file name / metadata would provide the source colorspace name of the file.
I'm trying to answer the question How one would encode colorspace metadata in a library of imagery files that would be easily translated to a code object for conversions.
OCIO is one way to go but I would like to see how colour would behave in that role.
Some technicalities to have a look at:
[a-zA-Z\d_]
sRGB
would becomesrgb
?Cheers.
Liam.
The text was updated successfully, but these errors were encountered: