Reputation: 2973
I noticed that Color
struct from System.Drawing
represents color in ARGB color space. So there are some questions:
That's all yet)
Thanks!
Upvotes: 1
Views: 3696
Reputation: 5566
You cannot directly convert argb to YUV (without loss) cause YUV contains no alpha information.
Depending on what you wanna do with the color after you have these possibilities:
you just cut the alpha and discard the transparency
you convert to a AYUV which contains also an alpha channel
conversion between color spaces
One possibility to convert a bitmap to a byte[] is to write it in a memorystream and read it bite wise.
MemoryStream stream = new MemoryStream();
bitmap.Save(stream, ImageFormat.Bmp);
byte[] data = stream.ToArray();
Upvotes: 2