GithubHelp home page GithubHelp logo

zschuessler / deltae Goto Github PK

View Code? Open in Web Editor NEW
254.0 11.0 25.0 30.38 MB

CIE color difference formulas in JavaScript

Home Page: http://zschuessler.github.io/DeltaE

License: The Unlicense

JavaScript 100.00%
chroma-key deltae cielab javascript

deltae's People

Contributors

petrochukm avatar zschuess-nerdery avatar zschuessler avatar

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

deltae's Issues

Calculation wrong

This Delta E calculation is wrong. For some insight I suggest reading this paper.

Details:

de({l: 60, a: -79.86355100472929, b: 60.18150231520482}, {l: 60, a: 79.86355100472929, b: -60.181502315204824}) = 59.58968443596155;

de({l: 60, a: -79.86355100472929, b: 60.18150231520482}, {l: 60, a: 79.863656041144, b: -60.18136292692152}) = 102.06502930178404;

How can that be right when the difference in the second color is extremely small (and no difference in the first color) but the resulting Delta E is radically different?

Should DeltaE return numbers over 100?

Hi

Reading http://zschuessler.github.io/DeltaE/learn/ it states that "Delta E value will range from 0 to 100". If I compare an orange and black using the following the code:

// Create two test LAB color objects to compare!
var color1 = {L: 100, A: 110, B: 110};
var color2 = {L: 0, A: 0, B: 0};

// 1976 formula
console.log(DeltaE.getDeltaE76(color1, color2));

// 1994 formula
console.log(DeltaE.getDeltaE94(color1, color2));

// 2000 formula
console.log(DeltaE.getDeltaE00(color1, color2));

I get the following results:

184.9324200890693
101.87291711716631
105.80638169501458

i.e. over 100 - is this a bug or is it valid to return values over 100?

I need to convert the value returned by DeltaE to a decimal so need to know what it's upper limit is (currently I artificially cap it at 100).

Thanks
Jon

One obvious speedup opprotunity

Since all you are doing is thresholding the distance relative to several reference points, you can forgo the sqrt() and just square the thresholds.
sqrt() is a a very expensive function - avoiding it may significantly improve performance.

“.getDeltaE94” returns a “NaN”. ……How come?

Alright, I just stumbled upon a very specific input that caused a mysterious crash.

const ΔE = require("delta-e");
const distance = ΔE.getDeltaE94(
	{
		L: 53.23288178584245,
		A: 80.10930952982204,
		B: 67.22006831026425
	},
	{
		L: 50.9588099835815,
		A: 77.47798295202801,
		B: 65.01211079141827
	}
);
console.log(distance); // NaN

This ends up returning a NaN. I believe nothing’s special about those numbers? What makes it so special that it crashes my application?

Performance somehow drops on local installation

I've been playing around with your chroma-key script and all seems to work excellent. However, after about half a minute performance starts dropping in every browser I use. While your online example has no problem whatsoever. It remains fast. I tried stripping everything so only the essentials are left and tried to use your online source, however without success.

Do you have any idea what the problem might be? My video is just 320px < 0.5MB and has a very bright / good background without noice since it's rendered and not recorded.

Also, I am ashamed to ask, but where does the noise in the background of the video on your site come from? I am pretty new with Canvas, but just don't see where the black and red are created / attached. I am obviously looking for a canvas without background so the rendered video is lying on top of my site.

Thanks!

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.