HeyRed.ImageSharp.Heif
2.1.0
See the version list below for details.
dotnet add package HeyRed.ImageSharp.Heif --version 2.1.0
NuGet\Install-Package HeyRed.ImageSharp.Heif -Version 2.1.0
<PackageReference Include="HeyRed.ImageSharp.Heif" Version="2.1.0" />
paket add HeyRed.ImageSharp.Heif --version 2.1.0
#r "nuget: HeyRed.ImageSharp.Heif, 2.1.0"
// Install HeyRed.ImageSharp.Heif as a Cake Addin #addin nuget:?package=HeyRed.ImageSharp.Heif&version=2.1.0 // Install HeyRed.ImageSharp.Heif as a Cake Tool #tool nuget:?package=HeyRed.ImageSharp.Heif&version=2.1.0
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())
};
using var inputStream = File.OpenRead("/path/to/image.avif"); // or image.heic
using var image = Image.Load(decoderOptions, inputStream);
// 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
};
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
Product | Versions 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. |
-
net6.0
- LibHeifSharp (>= 3.0.0)
- SixLabors.ImageSharp (>= 3.0.0)
NuGet packages
This package is not used by any NuGet packages.
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 | 225,059 | 10/12/2023 |
2.1.1 | 2,059 | 3/6/2023 |
2.1.0 | 240 | 3/5/2023 |
2.0.0 | 267 | 3/4/2023 |
1.0.0 | 4,862 | 11/16/2022 |
1.0.0-alpha.2 | 103 | 11/15/2022 |
1.0.0-alpha | 108 | 11/15/2022 |