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

Matrix-based extensibility #7

Open
svgeesus opened this issue May 24, 2021 · 3 comments
Open

Matrix-based extensibility #7

svgeesus opened this issue May 24, 2021 · 3 comments

Comments

@svgeesus
Copy link
Collaborator

Should we provide conveniences for matrix-based color spaces? Otherwise users need to supply their own matrix multiply (and possibly matrix invert).

Generalized libraries will be heavier in weight, while colorspace conversion just needs 3 x 1 and 3 x 3 multiply, and 3 x 3 invert.

@svgeesus
Copy link
Collaborator Author

In other words, to register a custom RGB colorspace: instead of computing off to the side the toXYZ and fromXYZ matrices, which requires access to a matrix multiply and matrix invert, the user would supply the red,green,blue and white chromaticities and the API would do the calculations and register the result.

The user would still need to provide functions to do the linearization and the gamma-encoding

@LeaVerou
Copy link
Collaborator

One problem is the Web Platform does not have a standard Matrix object. There’s DOMMatrix but that covers a very specific use case.
So if we add something like this, we'd need to accept matrices as an array of arrays (like in Color.js).

Also, it's pretty easy to write a helper that does this, so I'm not sure it has a place in the native API, at least in L1.

@svgeesus
Copy link
Collaborator Author

we'd need to accept matrices as an array of arrays (like in Color.js)

Yes. I meant matrix-based in distinction to lookup-based (like CMYK colorspace definitions).

@LeaVerou LeaVerou added this to the Level 2+ milestone Mar 20, 2024
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

2 participants