What are you doing with the output created by the ToByteArray method? If you only need the pixels you might be better of calling reference.ToByteArray() with MagickFormat.Rgb or MagickFormat.Rgba as an argument. You can control the pixel order by setting the Interlace property before you call ToByteArray. You don't need the call to ToBitmap anymore if you specify the format as an argument for the ToByteArray method.
↧