Thank you for your help, but this formulas like many others the same result and I start thinking it is not formulas problem, but something else. I take the pixel color from image in Gimp and got RGB 89,92,255 but when i take the same pixel from my program I get RGB 89,92,16.