chartjs-color icon indicating copy to clipboard operation
chartjs-color copied to clipboard

Consider re-evaluating YIQ formula

Open simonbrunel opened this issue 8 years ago • 4 comments

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;

simonbrunel avatar Oct 24 '16 20:10 simonbrunel

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.

Qix- avatar Jan 25 '17 10:01 Qix-

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

simonbrunel avatar Jan 25 '17 11:01 simonbrunel

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 https://github.com/chartjs/Chart.js/issues/3823#issuecomment-275078341.

Qix- avatar Jan 25 '17 11:01 Qix-

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.

zlumer avatar Jan 25 '17 14:01 zlumer