For a school project I have to make an converter that extracts Y, Cb and Cr channels from a picture.
I found the calculations on the internet but the result doesn't look like any example. So I think I didn't use the calculated value right. I don't really find anything for YCbCr in Pascal ... because I don't really know what to do I rounded them which brought the result you can see on the attached image.
y:= R * 0.29900 + G * 0.58700 + B * 0.11400;
cb:= R * -0.16874 + G * -0.33126 + B * 0.50000 + 128;
cr:= R * 0.50000 + G * -0.41869 + B * -0.08131 + 128;
//
Edit: I figured it out. I did an rough mistake while drawing the new canvases. New and correct result :
https://i.gyazo.com/35034be3de10217561b98ddb4b4f243c.png.