QuantizationAlgorithm Enum
Represents different kind of quantization methods.
public enum QuantizationAlgorithm
Inheritance: ObjectValueTypeEnumQuantizationAlgorithm
Fields
QuantizationAlgorithm.Octree | 0 | Represents Octree quantization. |
QuantizationAlgorithm.WebSafe | 1 | Represents WebSafe quantization. |
QuantizationAlgorithm.Werner | 2 | Represents Werner quantization. |
QuantizationAlgorithm.Wu | 3 | Represents Wu quantization. |
Licensing Info
This enum is a DynamicPDF Rasterizer feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Rasterizer selected.
- A DynamicPDF Rasterizer for .NET v4.X Developer license.
Examples
This example demonstrates the usage of QuantizationAlgorithm enum in indexed image creation.
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);
}
}