SkiaSharp.Heic 0.0.1

dotnet add package SkiaSharp.Heic --version 0.0.1
                    
NuGet\Install-Package SkiaSharp.Heic -Version 0.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SkiaSharp.Heic" Version="0.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SkiaSharp.Heic" Version="0.0.1" />
                    
Directory.Packages.props
<PackageReference Include="SkiaSharp.Heic" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SkiaSharp.Heic --version 0.0.1
                    
#r "nuget: SkiaSharp.Heic, 0.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SkiaSharp.Heic@0.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SkiaSharp.Heic&version=0.0.1
                    
Install as a Cake Addin
#tool nuget:?package=SkiaSharp.Heic&version=0.0.1
                    
Install as a Cake Tool

SkiaSharp.Heic

NuGet License

HEIC/HEIF image format decoding support for SkiaSharp. Decode HEIC images to SKBitmap and SKImage, with multi-frame support.

Features

  • Decode HEIC/HEIF images to SkiaSharp SKBitmap and SKImage
  • Convert HEIC to other formats (PNG, JPEG, WEBP, etc.) via SkiaSharp encoding
  • Multi-frame support for HEIC files with multiple images
  • Cross-platform - pure C# implementation, works on Windows, macOS, Linux, iOS, Android
  • Async support for non-blocking I/O operations

Installation

dotnet add package SkiaSharp.Heic

Or via NuGet Package Manager:

Install-Package SkiaSharp.Heic

Quick Start

Basic Decoding

using SkiaSharp;
using SkiaSharp.Heic;

// Decode HEIC to SKBitmap
using var bitmap = HeicDecoder.Decode("photo.heic");

// Or from a stream
using var stream = File.OpenRead("photo.heic");
using var bitmap2 = HeicDecoder.Decode(stream);

Convert HEIC to Other Formats

using SkiaSharp;
using SkiaSharp.Heic;

// Decode and convert to PNG
using var bitmap = HeicDecoder.Decode("photo.heic");
bitmap.SaveToFormat("photo.png", SKEncodedImageFormat.Png);

// Convert to JPEG with quality setting
bitmap.SaveToFormat("photo.jpg", SKEncodedImageFormat.Jpeg, quality: 85);

// Convert to WEBP
bitmap.SaveToFormat("photo.webp", SKEncodedImageFormat.Webp, quality: 90);

Access Image Information

using SkiaSharp.Heic;

using var info = HeicDecoder.DecodeWithInfo("photo.heic");

Console.WriteLine($"Dimensions: {info.ImageInfo.Width}x{info.ImageInfo.Height}");
Console.WriteLine($"Has Alpha: {info.HasAlpha}");
Console.WriteLine($"Frame count: {info.Frames.Count}");

Multi-Frame Support

using SkiaSharp.Heic;

using var info = HeicDecoder.DecodeWithInfo("multi-image.heic");

Console.WriteLine($"Frame count: {info.Frames.Count}");
Console.WriteLine($"Is animated: {info.IsAnimated}");

foreach (var frame in info.Frames)
{
    Console.WriteLine($"Frame {frame.Id}: {frame.Width}x{frame.Height}");

    using var frameBitmap = frame.ToBitmap();
    // Process frame...
}

// Get thumbnail if available
using var thumbnail = info.GetThumbnail();

Async Operations

using SkiaSharp.Heic;

// Async decoding
using var bitmap = await HeicDecoder.DecodeAsync("photo.heic");

// Async format conversion
await bitmap.SaveToFormatAsync("photo.png", SKEncodedImageFormat.Png);

Validation

using SkiaSharp.Heic;

// Check if a file is a valid HEIC image
using var stream = File.OpenRead("unknown.file");
if (HeicDecoder.CanDecode(stream))
{
    using var bitmap = HeicDecoder.Decode(stream);
    // Process...
}

// Try pattern for safe decoding
if (HeicDecoder.TryDecode("photo.heic", out var bitmap))
{
    using (bitmap)
    {
        // Process...
    }
}

Supported Platforms

Platform Support
Windows x64/ARM64
Linux x64/ARM64
macOS x64/ARM64
iOS
Android

Supported Output Formats

When converting from HEIC, you can use any format supported by SkiaSharp:

  • PNG
  • JPEG
  • WEBP
  • BMP
  • GIF
  • ICO

Dependencies

Limitations

  • Decoding only - This library only supports decoding HEIC files. Encoding to HEIC format is not supported.
  • EXIF metadata - EXIF metadata extraction is not currently supported by the underlying Openize.HEIC decoder.
  • HDR images - HDR HEIC images are not supported by the underlying decoder.
  • P/B-slice animations - Only I-slice animations are supported.

License

This project is licensed under the MIT License - see the LICENSE file for details.

HEVC Patent Notice

HEIC images use the HEVC (H.265) codec, which is covered by patents. Users are responsible for ensuring compliance with HEVC patent licensing requirements for commercial use. See Access Advance for more information.

Test Images

Test images used in this project are from tigranbs/test-heic-images.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Acknowledgments

  • Openize for the excellent HEIC decoder library
  • SkiaSharp team for the cross-platform graphics library
  • tigranbs for providing test HEIC images
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.1 131 1/26/2026