Skip to main content

DitheringAlgorithm Enum

Version: 4.0

DitheringAlgorithm Enum

Represents different dithering algorithms.

public enum DitheringAlgorithm
Public Enum DitheringAlgorithm

Inheritance: Object → ValueType → Enum → DitheringAlgorithm

Fields​

DitheringAlgorithm.Bayer1Bayer's pattern based algorithm.
DitheringAlgorithm.FloydSteinberg0Floyd-Steinberg diffusion kind of algorithm.
DitheringAlgorithm.None2No Dithering.

Licensing Info​

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

Examples​

This example demonstrates how to rasterize a PDF document to Gif image using FloydSteinberg dithering.

Imports System
Imports ceTe.DynamicPDF.Rasterizer

Module MyModule

Sub Main()'Create a PdfRasterizer object.Dim rasterizer As New PdfRasterizer("InputPdfFile.pdf")
'Create a GifImageFormat object.Dim gifImageFormat As New GifImageFormat()
'Set the DitheringAlgorithm to FloydSteinberg.gifImageFormat.DitheringAlgorithm = DitheringAlgorithm.FloydSteinberg
'Set the size.Dim fixedImageSize As New FixedImageSize(595, 841)
'Save the image.rasterizer.Draw("Output.Gif", gifImageFormat, 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 GifImageFormat object. GifImageFormat gifImageFormat = new GifImageFormat();
//Set the DitheringAlgorithm to FloydSteinberg. gifImageFormat.DitheringAlgorithm = DitheringAlgorithm.FloydSteinberg;
//Set the size. FixedImageSize fixedImageSize = new FixedImageSize(595, 841);
//Save the image. rasterizer.Draw("Output.Gif", gifImageFormat, fixedImageSize);
}

}

See Also​

ceTe.DynamicPDF.Rasterizer