Skip to main content
Notice removed Draw attention by CommunityBot
Bounty Ended with no winning answer by CommunityBot
Notice added Draw attention by kevinarpe
Bounty Started worth 100 reputation by kevinarpe
deleted 3 characters in body
Source Link
kevinarpe
  • 829
  • 4
  • 13

I am writing some computer code to convert color pixels to grayscale. There are many algorithms. I will be using the algorithm from the HDTV standard.

Unfortunately, my maths are a little weak, so I want someone (stronger in maths or physics) to explain the correct way to apply gamut (de)compress and how it affects the HDTV formula to convert color to grayscale, e.g, Y = 0.2126 R + 0.7152 G + 0.0722 B

Is it best to ask this question on (i) StackOverflow, (ii) Photography, (iii) Maths, or (iv) Physics sites? Please advise.

Update

Here are some quotes that appear to disagree from Wikipedia (my main source for learning about colorspace theory... probably not the best!). Specifically, I see discrepancies with how Y (linear / gamma decompressed) and Y' (non-linear / gamma compressed) are used.

Ref1

For the ITU-R BT.709 primaries, as used in sRGB, the weighting Y = 0.2126 R + 0.7152 G + 0.0722 B gives the CIE 1931 luminance, Y, as the result. Linear luminance typically needs to be gamma compressed to get back to a conventional grayscale representation. ... This is not the method used to obtain the luma in the Y'UV and related color models, used in standard color TV and video systems as PAL, SECAM, and NTSC. These systems directly compute a gamma-compressed luma as a linear combination of gamma-compressed primary intensities, rather than use linearization via gamma expansion and compression.

Ref2: See the conversion matrix between Y'UV and RGB.

Ref3

Y' stands for the luma component (the brightness) and U and V are the chrominance (color) components; luminance is denoted by Y and luma by Y' – the prime symbols (') denote gamma compression,1 with "luminance" meaning perceptual (color science) brightness, while "luma" is electronic (voltage of display) brightness.

I am writing some computer code to convert color pixels to grayscale. There are many algorithms. I will be using the algorithm from the HDTV standard.

Unfortunately, my maths are a little weak, so I want someone (stronger in maths or physics) to explain the correct way to apply gamut (de)compress and how it affects the HDTV formula to convert color to grayscale, e.g, Y = 0.2126 R + 0.7152 G + 0.0722 B

Is it best to ask this question on (i) StackOverflow, (ii) Photography, (iii) Maths, or (iv) Physics sites? Please advise.

Update

Here are some quotes that appear to disagree from Wikipedia (my main source for learning about colorspace theory... probably not the best!). Specifically, I see discrepancies with how Y (linear / gamma decompressed) and Y' (non-linear / gamma compressed) are used.

Ref1

For the ITU-R BT.709 primaries, as used in sRGB, the weighting Y = 0.2126 R + 0.7152 G + 0.0722 B gives the CIE 1931 luminance, Y, as the result. Linear luminance typically needs to be gamma compressed to get back to a conventional grayscale representation. ... This is not the method used to obtain the luma in the Y'UV and related color models, used in standard color TV and video systems as PAL, SECAM, and NTSC. These systems directly compute a gamma-compressed luma as a linear combination of gamma-compressed primary intensities, rather than use linearization via gamma expansion and compression.

Ref2: See the conversion matrix between Y'UV and RGB.

Ref3

Y' stands for the luma component (the brightness) and U and V are the chrominance (color) components; luminance is denoted by Y and luma by Y' – the prime symbols (') denote gamma compression,1 with "luminance" meaning perceptual (color science) brightness, while "luma" is electronic (voltage of display) brightness.

I am writing some computer code to convert color pixels to grayscale. There are many algorithms. I will be using the algorithm from the HDTV standard.

Unfortunately, my maths are a little weak, so I want someone (stronger in maths or physics) to explain the correct way to apply gamut (de)compress and how it affects the HDTV formula to convert color to grayscale, e.g, Y = 0.2126 R + 0.7152 G + 0.0722 B

Is it best to ask this question on (i) StackOverflow, (ii) Photography, (iii) Maths, or (iv) Physics sites? Please advise.

Update

Here are some quotes that appear to disagree from Wikipedia (my main source for learning about colorspace theory... probably not the best!). Specifically, I see discrepancies with how Y (linear / gamma decompressed) and Y' (non-linear / gamma compressed) are used.

Ref1

For the ITU-R BT.709 primaries, as used in sRGB, the weighting Y = 0.2126 R + 0.7152 G + 0.0722 B gives the CIE 1931 luminance, Y, as the result. Linear luminance typically needs to be gamma compressed to get back to a conventional grayscale representation. ... This is not the method used to obtain the luma in the Y'UV and related color models, used in standard color TV and video systems as PAL, SECAM, and NTSC. These systems directly compute a gamma-compressed luma as a linear combination of gamma-compressed primary intensities, rather than use linearization via gamma expansion and compression.

Ref2: See the conversion matrix between Y'UV and RGB.

Ref3

Y' stands for the luma component (the brightness) and U and V are the chrominance (color) components; luminance is denoted by Y and luma by Y' – the prime symbols (') denote gamma compression, with "luminance" meaning perceptual (color science) brightness, while "luma" is electronic (voltage of display) brightness.

add big update!
Source Link
kevinarpe
  • 829
  • 4
  • 13

I am writing some computer code to convert color pixels to grayscale. There are many algorithms. I will be using the algorithm from the HDTV standard.

Unfortunately, my maths are a little weak, so I want someone (stronger in maths or physics) to explain the correct way to apply gamut (de)compress and how it affects the HDTV formula to convert color to grayscale, e.g, Y = 0.2126 R + 0.7152 G + 0.0722 B

Is it best to ask this question on (i) StackOverflow, (ii) Photography, (iii) Maths, or (iv) Physics sites? Please advise.

Update

Here are some quotes that appear to disagree from Wikipedia (my main source for learning about colorspace theory... probably not the best!). Specifically, I see discrepancies with how Y (linear / gamma decompressed) and Y' (non-linear / gamma compressed) are used.

Ref1

For the ITU-R BT.709 primaries, as used in sRGB, the weighting Y = 0.2126 R + 0.7152 G + 0.0722 B gives the CIE 1931 luminance, Y, as the result. Linear luminance typically needs to be gamma compressed to get back to a conventional grayscale representation. ... This is not the method used to obtain the luma in the Y'UV and related color models, used in standard color TV and video systems as PAL, SECAM, and NTSC. These systems directly compute a gamma-compressed luma as a linear combination of gamma-compressed primary intensities, rather than use linearization via gamma expansion and compression.

Ref2: See the conversion matrix between Y'UV and RGB.

Ref3

Y' stands for the luma component (the brightness) and U and V are the chrominance (color) components; luminance is denoted by Y and luma by Y' – the prime symbols (') denote gamma compression,1 with "luminance" meaning perceptual (color science) brightness, while "luma" is electronic (voltage of display) brightness.

I am writing some computer code to convert color pixels to grayscale. There are many algorithms. I will be using the algorithm from the HDTV standard.

Unfortunately, my maths are a little weak, so I want someone (stronger in maths or physics) to explain the correct way to apply gamut (de)compress and how it affects the HDTV formula to convert color to grayscale, e.g, Y = 0.2126 R + 0.7152 G + 0.0722 B

Is it best to ask this question on (i) StackOverflow, (ii) Photography, (iii) Maths, or (iv) Physics sites? Please advise.

I am writing some computer code to convert color pixels to grayscale. There are many algorithms. I will be using the algorithm from the HDTV standard.

Unfortunately, my maths are a little weak, so I want someone (stronger in maths or physics) to explain the correct way to apply gamut (de)compress and how it affects the HDTV formula to convert color to grayscale, e.g, Y = 0.2126 R + 0.7152 G + 0.0722 B

Is it best to ask this question on (i) StackOverflow, (ii) Photography, (iii) Maths, or (iv) Physics sites? Please advise.

Update

Here are some quotes that appear to disagree from Wikipedia (my main source for learning about colorspace theory... probably not the best!). Specifically, I see discrepancies with how Y (linear / gamma decompressed) and Y' (non-linear / gamma compressed) are used.

Ref1

For the ITU-R BT.709 primaries, as used in sRGB, the weighting Y = 0.2126 R + 0.7152 G + 0.0722 B gives the CIE 1931 luminance, Y, as the result. Linear luminance typically needs to be gamma compressed to get back to a conventional grayscale representation. ... This is not the method used to obtain the luma in the Y'UV and related color models, used in standard color TV and video systems as PAL, SECAM, and NTSC. These systems directly compute a gamma-compressed luma as a linear combination of gamma-compressed primary intensities, rather than use linearization via gamma expansion and compression.

Ref2: See the conversion matrix between Y'UV and RGB.

Ref3

Y' stands for the luma component (the brightness) and U and V are the chrominance (color) components; luminance is denoted by Y and luma by Y' – the prime symbols (') denote gamma compression,1 with "luminance" meaning perceptual (color science) brightness, while "luma" is electronic (voltage of display) brightness.

Source Link
kevinarpe
  • 829
  • 4
  • 13
Loading