[issue40668] Catastrophic loss of precision in colorsys module

2020-05-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is correct. Colorspaces for RGB an YIQ are different. Not all RGB colors can be represented in YIQ and vice versa. For YIQ color (0, 1, 0) you need RGB color (0.9468822170900693, -0.27478764629897834, -1.1085450346420322), but the G and B components

[issue40668] Catastrophic loss of precision in colorsys module

2020-05-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: See https://bugs.python.org/issue14323 -- nosy: +rhettinger, serhiy.storchaka ___ Python tracker ___

[issue40668] Catastrophic loss of precision in colorsys module

2020-05-18 Thread Zac Hatfield-Dodds
New submission from Zac Hatfield-Dodds : As part of the Mentored Sprints at PyCon US, Marielle wrote some property-based tests [1] for the colorsys module [2], which found two bugs. Taking a YIQ color, converting to RGB, and back to YIQ can result in the Y coordinate varying by more 0.1