public static Raw8UBitmapDecoder Create(byte[] pixels, int width, int height)
{
BitmapSource frame = BitmapSource.Create(width, height, 96, 96, PixelFormats.Gray8, null, pixels, width);
List<BitmapFrame> frames = new List<BitmapFrame>();
frames.Add(BitmapFrame.Create(frame));
return new Raw8UBitmapDecoder() { frames = frames };
}