Package com.pdftools.pdf2image
Enum DitheringMode
- java.lang.Object
-
- java.lang.Enum<DitheringMode>
-
- com.pdftools.pdf2image.DitheringMode
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<DitheringMode>
public enum DitheringMode extends java.lang.Enum<DitheringMode>
The dithering algorithm for converting to bitonal images
Dithering is the process of converting continuous-tone (grayscale or color) content to black-and-white (bitonal) representation. Different algorithms offer trade-offs between visual quality and compression efficiency.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ATKINSONAtkinson ditheringFLOYD_STEINBERGFloyd-Steinberg ditheringHALFTONEHalftone ditheringNONENo dithering
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DitheringModevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static DitheringMode[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NONE
public static final DitheringMode NONE
No dithering
Simple thresholding without dithering. Best for clean line art and text-only documents.
-
HALFTONE
public static final DitheringMode HALFTONE
Halftone dithering
Ordered halftone dithering using a periodic pattern. Provides a good balance between visual quality and compression.
-
FLOYD_STEINBERG
public static final DitheringMode FLOYD_STEINBERG
Floyd-Steinberg dithering
Error diffusion dithering that distributes quantization errors to neighboring pixels. Produces high-quality results, especially for photographic content.
-
ATKINSON
public static final DitheringMode ATKINSON
Atkinson dithering
A variant of error diffusion dithering that produces results with good compression characteristics.
-
-
Method Detail
-
values
public static DitheringMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (DitheringMode c : DitheringMode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DitheringMode valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
-