Provides extra options for loading and saving Avif images.
public class CodecsAvifOptions
@interface LTCodecsAvifOptions : NSObject
public class CodecsAvifOptions
public ref class CodecsAvifOptions
class CodecsAvifOptions:
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing.Core;
using Leadtools.Pdf;
public void CodecsAvifOptionsExample(string srcFile)
{
// Loading
using (RasterCodecs codecs = new RasterCodecs())
{
// Load with multi-threading
codecs.Options.Avif.Load.Multithreaded = true;
using (RasterImage image = codecs.Load(srcFile))
{
// Display Image information
Console.WriteLine("----------");
Console.WriteLine("Image: " + srcFile);
Console.WriteLine("Width: " + image.Width);
Console.WriteLine("Height: " + image.Height);
Console.WriteLine("bpp: " + image.BitsPerPixel);
// Saving
string srcName = Path.GetFileNameWithoutExtension(srcFile);
string dstFileLossless = Path.Combine(LEAD_VARS.ImagesDir, srcName + "_dst_lossless.avif");
string dstFileLossy = Path.Combine(LEAD_VARS.ImagesDir, srcName + "_dst_lossy.avif");
// Stamp options
codecs.Options.Avif.Save.SaveWithStamp = true;
codecs.Options.Avif.Save.StampWidth = image.Width / 8;
codecs.Options.Avif.Save.StampHeight = image.Height / 8;
codecs.Options.Avif.Save.StampBitsPerPixel = 24;
// Save with lossless compression (qFactor = 0)
codecs.Options.Avif.Save.QualityFactor = 0;
codecs.Save(image, dstFileLossless, RasterImageFormat.Avif, 24);
// Save with lossy compression (qFactor = 1-63)
codecs.Options.Avif.Save.QualityFactor = 40;
codecs.Save(image, dstFileLossy, RasterImageFormat.Avif, 24);
}
}
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images";
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document