Skip to content
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

Enhanced constants precision #32

Open
maandree opened this issue Jun 15, 2017 · 5 comments
Open

Enhanced constants precision #32

maandree opened this issue Jun 15, 2017 · 5 comments

Comments

@maandree
Copy link

Hi! I'm working on a similar C library.
https://github.com/maandree/libcolour

@dy
Copy link
Member

dy commented Jun 15, 2017

Awesome!
Feel free to take any code you may find useful.
Also if you have rare color-spaces - youre welcome to contribute!

@dy dy closed this as completed Jun 15, 2017
@maandree
Copy link
Author

I don't think I have any colour space you don't, except a lot of RGB colour spaces, but if I get any you don't have, I will let you know.

I do however have very exact numbers and not the rounded numbers you find everywhere.

Here are some things I have that might be interesting:

Standard illuminants with values calculated from the wavelength tables:
https://github.com/maandree/libcolour/blob/d9fd5eb7fbbcbf47c7398c591d7eda0ef2c5cce7/libcolour.h#L65-L106

sRGB transfer function encoder/decoder with very exact values:
https://github.com/maandree/libcolour/blob/d9fd5eb7fbbcbf47c7398c591d7eda0ef2c5cce7/common.h#L41-L65

Not sure if this will make any difference in JavaScript, but I have a bit more precise matrix for conversion from sRGB to CIE XYZ:
https://github.com/maandree/libcolour/blob/d9fd5eb7fbbcbf47c7398c591d7eda0ef2c5cce7/matrices.py#L114-L122

A bunch of RGB colour spaces:
https://github.com/maandree/libcolour/blob/d9fd5eb7fbbcbf47c7398c591d7eda0ef2c5cce7/libcolour-template.c#L362-L632
with their transfer functions:
https://github.com/maandree/libcolour/blob/d9fd5eb7fbbcbf47c7398c591d7eda0ef2c5cce7/libcolour-template.c#L255-L332

And support for custom RGB colour spaces:
https://github.com/maandree/libcolour/blob/d9fd5eb7fbbcbf47c7398c591d7eda0ef2c5cce7/libcolour-template.c#L129-L227

@dy dy reopened this Jun 15, 2017
@dy
Copy link
Member

dy commented Jun 15, 2017

Ok, that is a possible enhancement

@dy dy changed the title Similar project Enhanced constants precision Jun 15, 2017
@demurgos
Copy link

I agree that it would be great if you could clarify the situation around RGB color spaces. I'd say that most people refer to "sRGB" when they say "RGB" but there are many other variants such as linear RGB, CIE RGB or all the variants in maandree's project.

@maandree
Copy link
Author

It is worth noting that is not uncommon that the term RGB is used to refer to CIE RGB without its transfer function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants