i need convert RGB image to YCbCr colour space, but have some colour shift problems, i used all formulas and got the same result.
Formula in python
cbcr[0] = int(0.299*rgb[0] + 0.587*rgb[1] + 0.114*rgb[2]) #Y
cbcr[1] = int(-0.1687*rgb[0] - 0.3313*rgb[1] + 0.5*rgb[2] + 128) #Cb
cbcr[2] = int( 0.5*rgb[0] - 0.4187*rgb[1] - 0.0813*rgb[2] + 128) #Cr
I know that i should get the same image with different way to record data, but i got wrong colour result.
http://i.imgur.com/zHuv8yq.png Original
http://i.imgur.com/Ek2WEA1.png Result
So how i can get normal image or convert RGB PNG into YCbCr 4:2:2?