DotAvifConverter 1.0.1

dotnet add package DotAvifConverter --version 1.0.1                
NuGet\Install-Package DotAvifConverter -Version 1.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="DotAvifConverter" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DotAvifConverter --version 1.0.1                
#r "nuget: DotAvifConverter, 1.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.
// Install DotAvifConverter as a Cake Addin
#addin nuget:?package=DotAvifConverter&version=1.0.1

// Install DotAvifConverter as a Cake Tool
#tool nuget:?package=DotAvifConverter&version=1.0.1                

Dot Avif Image Convertor

An .avif image convertor for .net. Uses cavif to do that.

NuGet Package

PM> Install-Package DotAvifConverter

Installation

1 - First you need to download the cavif prebuilt files and place them next to your application. <br/> Download from here

2 - Make sure the cavif files are placed correctly e.g. like this:

./YourApplicationHere.exe
./YourApplicationHere.dll
./runtimes/win/cavif.exe
./runtimes/mac/cavif
./runtimes/linux-generic/cavif

You can change the root location of runtimes using AvifConverter.SetBinaryRoot method.

3 - You can call the EncodeImage method now.

How to use

After installing the package, you only need to call the AvifConverter.EncodeImage method.

Simple configurations:

await AvifConverter.EncodeImage("source.jpeg");

This will generate source.avif next to the source.

Setting the output target

await AvifConverter.EncodeImage("source.jpeg", "output.avif");

More options

Using AvifConverterOptions you can customize the configuration.

await AvifConverter.EncodeImage("source.jpeg", "output.avif", new AvifConverterOptions
{
	Speed = 6,
	Quality = 80
});

Properties of AvifConverterOptions Some copies are from cavif repo:

Property Description
Quality Quality from 1 (worst) to 100 (best), the default value is 80. The numbers have different meaning than JPEG's quality scale. Beware when comparing codecs. There is no lossless compression support.
Speed Encoding speed between 1 (best, but slowest) and 10 (fastest, but a blurry mess), the default value is 4. Speeds 1 and 2 are unbelievably slow, but make files ~3-5% smaller. Speeds 7 and above degrade compression significantly, and are not recommended.
Overwrite Replace files if there's .avif already. By default the existing files are overwritten.
DirtyAlpha Preserve RGB values of fully transparent pixels (not recommended). By default irrelevant color of transparent pixels is cleared to avoid wasting space.
ColorRgb Encode using RGB instead of YCbCr color space. Makes colors closer to lossless, but makes files larger. Use only if you need to avoid even smallest color shifts.
EmitMesage Should generate output message
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 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 is compatible. 
.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 was computed. 
.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.
  • .NETStandard 2.0

    • No dependencies.
  • net6.0

    • No dependencies.
  • net9.0

    • No dependencies.

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
1.0.1 116 11/23/2024
1.0.0 569 8/29/2022

* Fixed the wrong default root path