diff --git a/dither-image.js b/dither-image.js index 8fd2179..2e6444e 100644 --- a/dither-image.js +++ b/dither-image.js @@ -79,8 +79,7 @@ class RGB { let lm = val & 15; let crlv = cr ? 50 : 0; - /* - let phase = ((cr - 1) * 25 - 58) * (2 * Math.PI / 360); + let phase = ((cr - 1) * 25 - 33) * (2 * Math.PI / 360); let y = 255 * (lm + 1) / 16; let i = crlv * Math.cos(phase); @@ -89,8 +88,8 @@ class RGB { let r = y + 0.956 * i + 0.621 * q; let g = y - 0.272 * i - 0.647 * q; let b = y - 1.107 * i + 1.704 * q; - */ + /* // PAL let phase = ((cr - 1) * 25.7 - 15) * (2 * Math.PI / 360); @@ -101,6 +100,7 @@ class RGB { let r = y + 0.956 * i + 0.621 * q; let g = y - 0.272 * i - 0.647 * q; let b = y - 1.107 * i + 1.704 * q; + */ return new RGB(r, g, b).clamp().fromSRGB(); }