←Select platform

CodecsAvifOptions Class

Summary

Provides extra options for loading and saving Avif images.

Syntax

C#
Objective-C
C++/CLI
Java
Python
public class CodecsAvifOptions 
@interface LTCodecsAvifOptions : NSObject 
public class CodecsAvifOptions 
public ref class CodecsAvifOptions  
class CodecsAvifOptions: 

Example
C#
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"; 
} 

Requirements

Target Platforms

See Also

CodecsAvifOptions Members

Leadtools.Codecs Namespace

AV1 File Format (AVIF)

Help Version 23.0.2024.11.26
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Codecs Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.