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

Consider re-evaluating YIQ formula #2

Open
simonbrunel opened this issue Oct 24, 2016 · 4 comments
Open

Consider re-evaluating YIQ formula #2

simonbrunel opened this issue Oct 24, 2016 · 4 comments

Comments

@simonbrunel
Copy link
Member

simonbrunel commented Oct 24, 2016

Note: issue posted by @zlumer in the deprecated "color" repository on Jul 14 '16.

See index.js:201

As stated here: ColorFAQ

The coefficients 0.299, 0.587 and 0.114 properly computed luminance for monitors having phosphors that were contemporary at the introduction of NTSC television in 1953. They are still appropriate for computing video luma to be discussed below in section 11. However, these coefficients do not accurately compute luminance for contemporary monitors.

The proposed formula is as follows:

image

Or

yiq = (rgb[0] * 2126 + rgb[1] * 7152 + rgb[2] * 722) / 10000;
@Qix-
Copy link

Qix- commented Jan 25, 2017

Note: issue posted by @zlumer in the deprecated "color" repository on Jul 14 '16.

I don't see that issue anywhere in the issues tracker - apologies if it got lost in the ownership handoff.

@simonbrunel
Copy link
Member Author

@Qix- the issue was in chartjs/color repository that we decided to remove in favor of this one which is a real fork of your work.

I updated the link over index.js in the ticket description.

@Qix-
Copy link

Qix- commented Jan 25, 2017

Aha, gotcha. :)

I'd be down to change the coefficients in color. The note about the current coefficients being archaic and geared towards NTSC phosphors is quite interesting - it appears the tutorial the original author of that function used for the YIQ formula didn't do a whole lot of research.

I'm curious to see if there is a drastic change in the output, though. I've opened qix-/color#107 to do some research when I get a spare moment.

Side note: see chartjs/Chart.js#3823 (comment).

@zlumer
Copy link

zlumer commented Jan 25, 2017

Haha, I'm trying to remember why I even reported this issue in the first place. Don't have a clue where I used it, but pretty sure it should be changed according to standard.

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