GithubHelp home page GithubHelp logo

connorgr / d3-cam02 Goto Github PK

View Code? Open in Web Editor NEW
64.0 64.0 8.0 119 KB

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

HTML 35.58% JavaScript 32.77% Makefile 0.26% Python 2.05% C 29.33%

d3-cam02's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

d3-cam02's Issues

Should JCh use chroma and hue in CIECAM02-UCS opposed to CIECAM02?

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.

Undefined behavior outside of sRGB gamut: JCh and Jab colors return displayable RGB values

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.

JCh interpolation

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:
image
image

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).
image
image

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.

Conversion error

when I use d3.jch(2, 63, 248)+'', I got rgb(255, 0, 255), like red, maybe this is a bug?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.