How do I convert the following SixLabors.ImageSharp code into a byte[]
Image<Rgba32> myImage = new Image<Rgba32>();
byte[] myImageByteArray = ...
Someone suggested on a different post to use the following code:
Rgba32[] finalImageByteArray = finalImage
.GetPixelMemoryGroup()
.SelectMany(group => group.ToArray())
.ToArray();
However, this produces a Rgba32[], not a byte[]
Try this:
Some notes: