Closed
Description
To convert heic image to number of png frames or just one jpg file i'm using examples from your main page like this one:
using (var fs = new FileStream("filename.heic", FileMode.Open))
{
HeicImage image = HeicImage.Load(fs);
var pixels = image.GetByteArray(Heic.Decoder.PixelFormat.Bgra32);
var width = (int)image.Width;
var height = (int)image.Height;
var wbitmap = new WriteableBitmap(width, height, 72, 72, PixelFormats.Bgra32, null);
var rect = new Int32Rect(0, 0, width, height);
wbitmap.WritePixels(rect, pixels, 4 * width, 0);
using FileStream saveStream = new FileStream("output.jpg", FileMode.OpenOrCreate);
JpegBitmapEncoder encoder = new JpegBitmapEncoder();
encoder.Frames.Add(BitmapFrame.Create(wbitmap));
encoder.Save(saveStream);
}
But the output image is tiled with strange squares
What the cause of it and how to solve the problem?
Metadata
Metadata
Assignees
Labels
No labels