DotAvifConverter 1.0.0
dotnet add package DotAvifConverter --version 1.0.0
NuGet\Install-Package DotAvifConverter -Version 1.0.0
<PackageReference Include="DotAvifConverter" Version="1.0.0" />
paket add DotAvifConverter --version 1.0.0
#r "nuget: DotAvifConverter, 1.0.0"
// Install DotAvifConverter as a Cake Addin #addin nuget:?package=DotAvifConverter&version=1.0.0 // Install DotAvifConverter as a Cake Tool #tool nuget:?package=DotAvifConverter&version=1.0.0
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 | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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. |
.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. |
-
.NETStandard 2.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.0 | 563 | 8/29/2022 |