-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-45775: Implement rgb_to_yuv and yuv_to_rgb for colorsys #29512
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
Conversation
Misc/NEWS.d/next/Library/2021-11-10-00-22-14.bpo-45775.e5tVoB.rst
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the many updates ;-) Your PR not only add 2 new functions with tests, but also enhance the documentation and tests of existing functions!
I would appreciate a review from another core dev since I'm not used to the colorsys module.
| these color spaces are floating point values. In the YIQ and YUV space, the | ||
| Y coordinate is between 0 and 1, but the I, Q, U and V coordinates can be | ||
| positive or negative. In all other spaces, the coordinates are all between | ||
| 0 and 1. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we note what’s the range for I, Q, U, V too or is it obvious if you’re familiar with YIQ/YUV?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the BT.709 standard, U should be [-0.436...0.436], and V should be [-0.615...0.615], but since YIQ is using the FCC NTSC, its range in float terms (as opposed to wavelength terms) doesn't seem to be well documented (but it seems to be roughly [-0.5984...0.5984] for I, and [-0.5246..0.5246] for Q).
Since it's kind of varied I figure it's probably best to not bulk these in with this section, but maybe they belong somewhere else (e.g. with the methods?), or if there's a reliable document with these values it might be worth linking to that instead.
|
The https://bugs.python.org/issue45775 has been rejected. You can write your own module on PyPI with more advanced features if you want to extend colorsys ;-) |
https://bugs.python.org/issue45775
https://bugs.python.org/issue45775