public class ImageBinarizationMethod
Example:
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.getParagraphFormat().setStyle(doc.getStyles().get("Heading 1"));
builder.writeln("Hello world!");
builder.insertImage(getImageDir() + "Logo.jpg");
// When we save the document as a TIFF, we can pass a SaveOptions object to
// adjust the dithering that Aspose.Words will apply when rendering this image.
// The default value of the "ThresholdForFloydSteinbergDithering" property is 128.
// Higher values tend to produce darker images.
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() + "ImageSaveOptions.FloydSteinbergDithering.tiff", options);
Field Summary | ||
---|---|---|
static final int | THRESHOLD | |
Specifies threshold method.
|
||
static final int | FLOYD_STEINBERG_DITHERING | |
Specifies dithering using Floyd-Steinberg error diffusion method.
|