HeyRed.ImageSharp.Heif 2.1.3

dotnet add package HeyRed.ImageSharp.Heif --version 2.1.3
                    
NuGet\Install-Package HeyRed.ImageSharp.Heif -Version 2.1.3
                    
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="HeyRed.ImageSharp.Heif" Version="2.1.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="HeyRed.ImageSharp.Heif" Version="2.1.3" />
                    
Directory.Packages.props
<PackageReference Include="HeyRed.ImageSharp.Heif" />
                    
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 HeyRed.ImageSharp.Heif --version 2.1.3
                    
#r "nuget: HeyRed.ImageSharp.Heif, 2.1.3"
                    
#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 HeyRed.ImageSharp.Heif@2.1.3
                    
#: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=HeyRed.ImageSharp.Heif&version=2.1.3
                    
Install as a Cake Addin
#tool nuget:?package=HeyRed.ImageSharp.Heif&version=2.1.3
                    
Install as a Cake Tool

ImageSharp.Heif

HEIF/AVIF decoder for ImageSharp

🚧 WIP. Some features(like encoder) is not implemented.

Use libheif-sharp for all features provided by libheif.

Install

via NuGet:

PM> Install-Package HeyRed.ImageSharp.Heif

Native libs for x64 Linux and Windows:

PM> Install-Package LibHeif.Native

Separate native packages:

PM> Install-Package LibHeif.Native.win-x64
PM> Install-Package LibHeif.Native.linux-x64

Usage

using System.IO;

using SixLabors.ImageSharp;

using HeyRed.ImageSharp.Heif.Formats.Heif;
using HeyRed.ImageSharp.Heif.Formats.Avif;

var decoderOptions = new DecoderOptions()
{
    Configuration = new Configuration(
        new AvifConfigurationModule(), 
        new HeifConfigurationModule())
};

using var image = Image.Load(decoderOptions, "/path/to/image.avif"); // or image.heic

// Do something with image
...

Top level images

⚠️ Due to the ImageSharp limitations, decoding top level images with different sizes are not supported. ⚠️

Note: libheif have some limitations

By default DecodingMode set to PrimaryImage, but if you want decode all top level images see example listed below:

var decoderOptions = new HeifDecoderOptions
{
    DecodingMode = DecodingMode.TopLevelImages,
    // MaxFrames option is also supported
    GeneralOptions = new DecoderOptions
    {
        MaxFrames = 10,
    }
};

using var inputStream = File.OpenRead("/path/to/image.avif"); // or image.heic

using var image = HeifDecoder.Instance.Decode(decoderOptions, inputStream);

// Saves all frames
for (int i = 0; i < image.Frames.Count; i++)
{
    image.Frames
        .CloneFrame(i)
        .SaveAsJpeg($"frame{i}.jpg");
}

License

MIT

Product Compatible and additional computed target framework versions.
.NET 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 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on HeyRed.ImageSharp.Heif:

Package Downloads
UltronFramework.FileManager.AzCloud

Es un componente básico que ofrece implementaciones con azure cloud

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on HeyRed.ImageSharp.Heif:

Repository Stars
Particle1904/DatasetHelpers
Dataset Helper program to automatically select, re scale and tag Datasets (composed of image and text) for Machine Learning training.
Version Downloads Last Updated
2.1.3 535,224 10/12/2023
2.1.1 3,879 3/6/2023
2.1.0 1,694 3/5/2023
2.0.0 508 3/4/2023
1.0.0 25,706 11/16/2022
1.0.0-alpha.2 262 11/15/2022
1.0.0-alpha 293 11/15/2022