com.aspose.words

Class ImageColorMode

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

Utility class containing constants. Specifies the color mode for the generated images of document pages.

Example:

Show how to convert document images to black and white with 1 bit per pixel
Document doc = new Document(getMyDir() + "ImageSaveOptions.BlackAndWhite.docx");

ImageSaveOptions imageSaveOptions = new ImageSaveOptions(SaveFormat.PNG);
imageSaveOptions.setImageColorMode(ImageColorMode.BLACK_AND_WHITE);
imageSaveOptions.setPixelFormat(ImagePixelFormat.FORMAT_1_BPP_INDEXED);

// ImageSaveOptions instances can be cloned
Assert.assertNotEquals(imageSaveOptions.deepClone(), imageSaveOptions);

doc.save(getArtifactsDir() + "ImageSaveOptions.BlackAndWhite.png", imageSaveOptions);

Field Summary
static final intNONE = 0
The pages of the document will be rendered as color images.
static final intGRAYSCALE = 1
The pages of the document will be rendered as grayscale images.
static final intBLACK_AND_WHITE = 2
The pages of the document will be rendered as black and white images.
 

    • Field Detail

      • NONE = 0

        public static final int NONE
        The pages of the document will be rendered as color images.
      • GRAYSCALE = 1

        public static final int GRAYSCALE
        The pages of the document will be rendered as grayscale images.
      • BLACK_AND_WHITE = 2

        public static final int BLACK_AND_WHITE
        The pages of the document will be rendered as black and white images.