[issue45775] Implementation of colorsys.rgb_to_yuv and vice versa

2021-11-23 Thread Éric Araujo
Éric Araujo added the comment: Thank you for suggesting the improvement and working on a PR nonetheless! Hope the experience can be useful for other tickets in the future. -- ___ Python tracker

[issue45775] Implementation of colorsys.rgb_to_yuv and vice versa

2021-11-23 Thread Éric Araujo
Éric Araujo added the comment: I think that there’s no need to change the existing tests. The CPython project prefers to not do tiny improvements for their own sake. -- nosy: +eric.araujo ___ Python tracker

[issue45775] Implementation of colorsys.rgb_to_yuv and vice versa

2021-11-23 Thread Thomas Stolarski
Thomas Stolarski added the comment: I figured this would probably be the case, but since YIQ also requires a profile (and the FCC one it implements is pretty weird for digital work), I thought I'd give it a shot anyway. Would it be worth moving the test/formatting changes over to a

[issue45775] Implementation of colorsys.rgb_to_yuv and vice versa

2021-11-23 Thread STINNER Victor
STINNER Victor added the comment: You can write your own module on PyPI with more advanced features if you want to extend colorsys ;-) -- ___ Python tracker ___

[issue45775] Implementation of colorsys.rgb_to_yuv and vice versa

2021-11-23 Thread STINNER Victor
STINNER Victor added the comment: Ok, let's reject this feature and restrict colorsys to simple color spaces which don't require profiles. -- resolution: -> rejected stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue45775] Implementation of colorsys.rgb_to_yuv and vice versa

2021-11-23 Thread Petr Viktorin
Petr Viktorin added the comment: > YUV is a common color encoding system. It's used by the JPEG image format and > MPEG video format for example. As far as I understand it, the YUV/RGB conversion used by JPEG is not the same as the one used by MPEG, and neither of those is the Rec 709 YUV

[issue45775] Implementation of colorsys.rgb_to_yuv and vice versa

2021-11-18 Thread STINNER Victor
STINNER Victor added the comment: The GIMP image editor uses https://gegl.org/babl/ which supports tons of formats and supports color spaces, ICC profiles, etc. I would also prefer to keep colorsys simple and so not support ICC profiles for example. YUV is a common color encoding system.

[issue45775] Implementation of colorsys.rgb_to_yuv and vice versa

2021-11-18 Thread Petr Viktorin
Petr Viktorin added the comment: I argued for keeping colorsys: RGB/HLS/HSV are useful in several fields. Colorsys is a nice low-power battery to have around for e.g. picking a color for highlighting any kind of output. YIQ is the odd one out: it describes actual color, rather than

[issue45775] Implementation of colorsys.rgb_to_yuv and vice versa

2021-11-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: On pydev, Guido said "There was talk of deprecating colorsys, but PEP 594 now lists it under "modules to keep". Victor, do you know enough to review? -- ___ Python tracker

[issue45775] Implementation of colorsys.rgb_to_yuv and vice versa

2021-11-12 Thread STINNER Victor
STINNER Victor added the comment: > A link to an authoritative reference with the formulas would be necessary to > merge this. The PR says: "ATSC BT.709 standard constants". For exmaple, I found: https://en.wikipedia.org/wiki/Rec._709#Luma_coefficients "When encoding Y’CBCR video, BT.709

[issue45775] Implementation of colorsys.rgb_to_yuv and vice versa

2021-11-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: A link to an authoritative reference with the formulas would be necessary to merge this. I inquired of pydev list whether improvement is allowed. -- nosy: +terry.reedy ___ Python tracker

[issue45775] Implementation of colorsys.rgb_to_yuv and vice versa

2021-11-09 Thread Thomas Stolarski
Change by Thomas Stolarski : -- keywords: +patch pull_requests: +27763 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29512 ___ Python tracker

[issue45775] Implementation of colorsys.rgb_to_yuv and vice versa

2021-11-09 Thread Thomas Stolarski
New submission from Thomas Stolarski : Since the implementation of `rgb_to_yiq` roughly 30 years ago now, the advent of HDTV has resulted in most broadcasting and video processing having moved towards Rec 709 (or BT.709). While I know colorsys has been on the chopping block for a while, it