View Single Post
Old 5th October 2015, 14:10   #34  |  Link
Khanattila
Registered User
 
Khanattila's Avatar
 
Join Date: Nov 2014
Posts: 440
Example, Pink colour sRGB(255, 203, 219).

In unsigned-normalized is (255 / 255, 203 / 255, 219 / 255).

Convert to Y'PbPr (ITU-R BT.601). Take only Y' for this example.
Kr = 0.299 = 299 / 1000;
Kg = 1 - 0.114 - 0.299 = 0.587 = 587 / 1000;
Kb = 0.114 = 144 / 1000;

Y' = Kr * R + Kg * G + Kb * B =
= (299 / 1000) * (255 / 255) + (587 / 1000) * (203 / 255) + (144 / 1000) * (219 / 255) =
= (299 / 1000) + (119161 / 255000) + (1314 / 10625) =
= 113471 / 127500

In unsigned-int8 is 226.942 --> 226 ERROR!
In unsigned-int9 is 454.773968627451 --> 454 ERROR!
In unsigned-int10 is 910.4379058823529 --> 910 ERROR!
In unsigned-int16 is 58324.094 -> 58324 ERROR!
In unsigned-int24 is 14931195.006 --> 14931195 ERROR!
In unsigned-int32 is 3822386148.478 --> 3822386148 ERROR!

The only real thing that changes is the level of accuracy.
__________________
github.com
Khanattila is offline   Reply With Quote