Using C# and SkiaSharp I want to open a .heic bitmap image. My goal is to convert the .heic file to a .png or .jpg.
I have tried the following code:
SKBitmap bmp = SKBitmap.Decode(filePath);
When the filePath is to a .heic file it returns null. When the filePath is to e.g. a .jpg or .png it works fine. But I need to open .heic files.
Alternatively, are there other ways in C# to convert .heic files to .png or .jpg?
It seems that in current version (v1.68.1.1) of SkiaSharp .heic really just isn't supported.
The alternative way is to use ImageMagick.Net which is available as a Nuget package.
It is used as follows:
using (MagickImage bmp = new MagickImage(inpath))
{
bmp.Write(outpath, MagickFormat.Jpg);
}
If anyone knows how to get SkiaSharp to support .heic, please say so.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With