tiffBinarizationMethod property

ImageSaveOptions.tiffBinarizationMethod property

Gets or sets method used while converting images to 1 bpp format when ImageSaveOptions.saveFormat is SaveFormat.Tiff and ImageSaveOptions.tiffCompression is equal to TiffCompression.Ccitt3 or TiffCompression.Ccitt4.

get tiffBinarizationMethod(): Aspose.Words.Saving.ImageBinarizationMethod

Remarks

The default value is ImageBinarizationMethod.Threshold.

Examples

Shows how to set the TIFF binarization error threshold when using the Floyd-Steinberg method to render a TIFF image.

let doc = new aw.Document();
let builder = new aw.DocumentBuilder(doc);

builder.paragraphFormat.style = doc.styles.at("Heading 1");
builder.writeln("Hello world!");
builder.insertImage(base.imageDir + "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.
let options = new aw.Saving.ImageSaveOptions(aw.SaveFormat.Tiff)
{
  TiffCompression = aw.Saving.TiffCompression.Ccitt3,
  TiffBinarizationMethod = aw.Saving.ImageBinarizationMethod.FloydSteinbergDithering,
  ThresholdForFloydSteinbergDithering = 240
};

doc.save(base.artifactsDir + "ImageSaveOptions.floydSteinbergDithering.tiff", options);

See Also