I have a screen grabber which gives me a image in YUV 4:2:2 format.
I need to convert my byte[]'s to RGB format?
Please help, Jason
I have a screen grabber which gives me a image in YUV 4:2:2 format.
I need to convert my byte[]'s to RGB format?
Please help, Jason
A solution using integer only calculations (i.e. should be quicker than float/double calculations) is:
here you use the PixelYUV2RGB function to fill values in a byte array for rgb.
This is much quicker than the above, but is still sub-par in terms of performance for a full HD image in c#
You can use this library to convert from RGB, YUV, HSB, HSL and many other color formats, example using the static method at RGB class to convert from YUV, just call
And the underlying implementation of it:
There is code here to do exactly what you want, but the byte order for the RGB bitmap is inverted (exchange the reds and blues).