public void BitmapToImageDataTest()
        {
            var imagedata  = File.ReadAllBytes("testjpg.jpg");
            var bitmap_jpg = BitmapHelper.ImageDataToBitmap(imagedata);

            Assert.IsNotNull(bitmap_jpg);
            Assert.AreEqual(bitmap_jpg.PixelFormat, PixelFormat.Format24bppRgb);

            var jxlimagedata = BitmapHelper.BitmapToImageData(bitmap_jpg);

            Assert.IsNotNull(jxlimagedata);
            File.WriteAllBytes("testjxl.jxl", jxlimagedata);
        }
 public void GetMatrixTest()
 {
     using (var bitmap3x5 = new Bitmap(3, 5, PixelFormat.Format24bppRgb)) {
         bitmap3x5.SetPixel(0, 4, Color.White);
         var imagedata = BitmapHelper.BitmapToImageData(bitmap3x5);
         Assert.IsNotNull(imagedata);
         var matrix = BitmapHelper.GetMatrix(imagedata);
         Assert.IsNotNull(matrix);
         Assert.AreEqual(matrix[0][0], 0);
         Assert.AreEqual(matrix[0][2], 0);
         Assert.AreEqual(matrix[4][0], 100);
         Assert.AreEqual(matrix[4][2], 0);
     }
 }