QuantizationAlgorithm Enum

Represents different kind of quantization methods.

public enum QuantizationAlgorithm
Public Enum QuantizationAlgorithm

Inheritance: ObjectValueTypeEnumQuantizationAlgorithm

Fields

QuantizationAlgorithm.Octree0Represents Octree quantization.
QuantizationAlgorithm.WebSafe1Represents WebSafe quantization.
QuantizationAlgorithm.Werner2Represents Werner quantization.
QuantizationAlgorithm.Wu3Represents Wu quantization.

Licensing Info

This enum is a DynamicPDF Rasterizer feature. One of the following is required for non-evaluation usage:

Examples

This example demonstrates the usage of QuantizationAlgorithm enum in indexed image creation.

Imports System
Imports ceTe.DynamicPDF.Rasterizer

Module MyModule


   Sub Main()

       ' Create a PdfRasterizer object.
       Dim rasterizer As New PdfRasterizer("InputPdfFile.pdf")

       ' Create a PngIndexedColorFormat object. 
       Dim pngIndexedColorFormat As New PngIndexedColorFormat(ImageFormat.DefaultColorPalette,100,DitheringAlgorithm.FloydSteinberg)

       ' Set the Colorpalette property to AutoPalette.
       pngIndexedColorFormat.ColorPalette = New AutoPalette(QuantizationAlgorithm.Octree, 256)

       ' Create a PngImageFormat using PngIndexedColorFormat object.
       Dim pngImageFormat As New PngImageFormat(pngIndexedColorFormat)

       ' Set the size.
       Dim fixedImageSize As New FixedImageSize(595, 841)

       ' Save the image.
       rasterizer.Draw("Output.png", pngImageFormat, fixedImageSize)

   End Sub

End Module
using System;
using ceTe.DynamicPDF.Rasterizer;

class MyClass
{
   static void Main(string[] args)
   {
	   // Create a PdfRasterizer object.
   PdfRasterizer rasterizer = new PdfRasterizer("InputPdfFile.pdf");

   // Create a PngIndexedColorFormat object. 
   PngIndexedColorFormat pngIndexedColorFormat = new PngIndexedColorFormat(ImageFormat.DefaultColorPalette,100,DitheringAlgorithm.FloydSteinberg);

   // Set the Colorpalette property to AutoPalette.
   pngIndexedColorFormat.ColorPalette = new AutoPalette(QuantizationAlgorithm.Octree, 256);

   // Create a PngImageFormat using PngIndexedColorFormat object.
   PngImageFormat pngImageFormat = new PngImageFormat(pngIndexedColorFormat);

   // Set the size.
   FixedImageSize fixedImageSize = new FixedImageSize(595, 841);

   // Save the image.
   rasterizer.Draw("Output.png", pngImageFormat, fixedImageSize);
  
   }

}

See Also

ceTe.DynamicPDF.Rasterizer

In this topic