com.aspose.words

Class ImageBinarizationMethod

  • java.lang.Object
    • com.aspose.words.ImageBinarizationMethod
public class ImageBinarizationMethod 
extends java.lang.Object

Utility class containing constants. Specifies the method used to binarize image.

Example:

Shows how to control the threshold for TIFF binarization in the Floyd-Steinberg method
Document doc = new Document(getMyDir() + "ImagesSaveOptions.ThresholdForFloydSteinbergDithering.docx");

ImageSaveOptions options = new ImageSaveOptions(SaveFormat.TIFF);
options.setTiffCompression(TiffCompression.CCITT_3);
options.setImageColorMode(ImageColorMode.GRAYSCALE);
options.setTiffBinarizationMethod(ImageBinarizationMethod.FLOYD_STEINBERG_DITHERING);
// The default value of this property is 128. The higher value, the darker image.
options.setThresholdForFloydSteinbergDithering((byte) 254);

doc.save(getArtifactsDir() + "ImagesSaveOptions.ThresholdForFloydSteinbergDithering.tiff", options);

Field Summary
static final intTHRESHOLD = 0
Specifies threshold method.
static final intFLOYD_STEINBERG_DITHERING = 1
Specifies dithering using Floyd-Steinberg error diffusion method.
 

    • Field Detail

      • THRESHOLD = 0

        public static final int THRESHOLD
        Specifies threshold method.
      • FLOYD_STEINBERG_DITHERING = 1

        public static final int FLOYD_STEINBERG_DITHERING
        Specifies dithering using Floyd-Steinberg error diffusion method.