Update colorsys with YUV conversions?

https://github.com/python/cpython/pull/29512 adds what appears to be well written conversions between RGB and YUV color systems, with tests. Are we allowing such improvements? If not, a module docstring note or comment should be added.

I guess that you should agree on constants and then stick to them. Otherwise, we might have to add a parameter later to chose the conversion standard.
The PR uses "ATSC BT.709 standard constant".
Wikipedia says: "When encoding Y’CBCR video, BT.709 creates gamma-encoded luma (Y’) using matrix coefficients 0.2126, 0.7152, and 0.0722 (together they add to 1). BT.709-1 used slightly different 0.2125, 0.7154, 0.0721 (changed to standard ones in BT.709-2)." https://en.wikipedia.org/wiki/Rec._709#Luma_coefficients
Victor
On Fri, Nov 12, 2021 at 11:28 PM Terry Reedy tjreedy@udel.edu wrote:
https://github.com/python/cpython/pull/29512 adds what appears to be well written conversions between RGB and YUV color systems, with tests. Are we allowing such improvements? If not, a module docstring note or comment should be added.
-- Terry Jan Reedy
Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-leave@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/FV73RE3T... Code of Conduct: http://python.org/psf/codeofconduct/

There was talk of deprecating colorsys, but PEP 594 now lists it under "modules to keep" so I don't see why we couldn't improve it. The OP's reasons for doing so seem solid. I don't know anything about this topic so I'll leave it at that.
On Fri, Nov 12, 2021 at 2:22 PM Terry Reedy tjreedy@udel.edu wrote:
https://github.com/python/cpython/pull/29512 adds what appears to be well written conversions between RGB and YUV color systems, with tests. Are we allowing such improvements? If not, a module docstring note or comment should be added.
-- Terry Jan Reedy
Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-leave@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/FV73RE3T... Code of Conduct: http://python.org/psf/codeofconduct/
participants (3)
-
Guido van Rossum
-
Terry Reedy
-
Victor Stinner