matrixToPNG :: Int -> Int -> [Int] -> PicTypes.Image PicTypes.PixelRGB8
matrixToPNG w h matrix = PicTypes.generateImage rasterize w h where
  gray b = PicTypes.PixelRGB8 b b b
  rasterize x y = gray (fromIntegral (matrix !! (y * w + x)))
matrixToPNG :: Int -> Int -> [Int] -> PicTypes.Image PicTypes.PixelRGB8
matrixToPNG w h matrix = PicTypes.generateImage rasterize w h where
  gray b = PicTypes.PixelRGB8 b b b
  rasterize x y = gray (fromIntegral (matrix !! (y * w + x)))
matrixToPNG w h matrix = PicTypes.generateImage rasterize w h where
  gray b = PicTypes.PixelRGB8 b b b
  rasterize x y = gray (fromIntegral (matrix !! (y * w + x)))