You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
@Msey this looks like the miscalculations in cabac context variables. It's library issue, not the incorrent usage. Can you provide the original file for the futher research?
If you are interested in details, the image inside is represented as multiple 512*512 images, and each block is decoded separately. As a result even if there are miscalculations during decoding, the next square will start decoding with correct colors. This brings us this tile view.
@Msey
We'll research it and fix in the next versions.
We'll try to deliver this patch in Q1 2025, but there no real ETA untill the proper research is done.
Thank you for your patience!
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:
But the output image is tiled with strange squares
What the cause of it and how to solve the problem?
The text was updated successfully, but these errors were encountered: