connorgr / d3-cam02 Goto Github PK
View Code? Open in Web Editor NEWA d3 implementation of the CIECAM02 and CIECAM02-UCS color appearance models
Home Page: http://gramaz.io/d3-cam02
License: BSD 3-Clause "New" or "Revised" License
A d3 implementation of the CIECAM02 and CIECAM02-UCS color appearance models
Home Page: http://gramaz.io/d3-cam02
License: BSD 3-Clause "New" or "Revised" License
Line 422 in 945951e
Is this a typo? It causes for instance anything like jabcolor.copy()
to suddenly produce JCh instances and not new Jab instances.
The current implementation of d3-cam02 implements JCh in CIECAM02 whereas Jab is implemented in CIECAM02-UCS. Is this necessary? Can CIECAM02-UCS be used for both?
Right now J is not equivalent in the two functions, which I think is likely to cause unintentional user error. I don't have enough color science expertise to know whether CIECAM02-UCS supports the same set of specifications as CIECAM02 (e.g., C, H, h, Q, M, etc.). Input with someone who is more familiar with color science would be tremendously helpful.
Some Jab and JCh colors that are far outside of displayable RGB end up registering as defined, and I don't know why. For example:
d3.jch(12,90,90).displayable(); // === true
d3.jch(12,90,90).rgb(); // "rgb(65, 30, 5)"
This is consistent with the Colorspacious Python library as well as Billy Bigg's C implementation. It looks like this may not be the case with the Colour Python package, but their implementation differs so much I haven't had time to do a comprehensive comparison.
It would be nice to have JCh interpolation available for creating color maps. This is a nicer method of interpolation when you want to have a smoother transition across chroma from one color to the next.
This is similar to Lab/Lch interpolation outputs. Here is a comparison of interpolation in Jab vs Lab vs Lch from a blue to green color:
When visualizing this interpolation difference between cartesian and polar adaptations of color space, the polar takes a more curved transition. This can sometimes yield more aesthetically balanced color maps. Here is a visualization from top-down in LAB color space for the same scales (interpolated to black and white as well).
Lab interpolation in Lab space is purely linear, whereas Lch interpolation in Lab has curvature. This same curvature from a JCh interpolation would be desirable to include in this d3-cam02
library.
when I use d3.jch(2, 63, 248)+''
, I got rgb(255, 0, 255)
, like red, maybe this is a bug?
d3.rgb(d3.jab(0,0,0))
maps to NaN and similar issues for white, but exceeds the RGB gamut.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.