Enum ColorMode

Enum ColorMode

Namespace: Aspose.Note.Saving
Assembly: Aspose.Note.dll (25.3.0)

The color mode of the image.

public enum ColorMode

Fields

BlackAndWhite = 2

Binary image: only black and white colors are used

GrayScale = 1

Gray scale image

Normal = 0

Full color image

Examples

Shows how to save a document as grayscale image.

// The path to the documents directory.
                                                           string dataDir = RunExamples.GetDataDir_LoadingAndSaving();

                                                           // Load the document into Aspose.Note.
                                                           Document oneFile = new Document(dataDir + "Aspose.one");

                                                           dataDir = dataDir + "SaveAsGrayscaleImage_out.png";

                                                           // Save the document as gif.
                                                           oneFile.Save(dataDir, new ImageSaveOptions(SaveFormat.Png)
                                                                                     {
                                                                                         ColorMode = ColorMode.GrayScale
                                                                                     });

Shows how to save a document as image in Tiff format using CCITT Group 3 fax compression.

// The path to the documents directory.
                                                                                                    string dataDir = RunExamples.GetDataDir_LoadingAndSaving();

                                                                                                    // Load the document into Aspose.Note.
                                                                                                    Document oneFile = new Document(Path.Combine(dataDir, "Aspose.one"));

                                                                                                    var dst = Path.Combine(dataDir, "SaveToTiffUsingCcitt3Compression.tiff");

                                                                                                    // Save the document.
                                                                                                    oneFile.Save(dst, new ImageSaveOptions(SaveFormat.Tiff)
                                                                                                                          {
                                                                                                                              ColorMode = ColorMode.BlackAndWhite,
                                                                                                                              TiffCompression = TiffCompression.Ccitt3
                                                                                                                          });

Shows how to save a document as binary image using Otsu’s method.

// The path to the documents directory.
                                                                            string dataDir = RunExamples.GetDataDir_LoadingAndSaving();

                                                                            // Load the document into Aspose.Note.
                                                                            Document oneFile = new Document(dataDir + "Aspose.one");

                                                                            dataDir = dataDir + "SaveToBinaryImageUsingOtsuMethod_out.png";

                                                                            // Save the document as gif.
                                                                            oneFile.Save(dataDir, new ImageSaveOptions(SaveFormat.Png)
                                                                                                    {
                                                                                                        ColorMode = ColorMode.BlackAndWhite,
                                                                                                        BinarizationOptions = new ImageBinarizationOptions()
                                                                                                                              {
                                                                                                                                  BinarizationMethod = BinarizationMethod.Otsu,
                                                                                                                              }
                                                                                                    });

Shows how to save a document as binary image using fixed threshold.

// The path to the documents directory.
                                                                              string dataDir = RunExamples.GetDataDir_LoadingAndSaving();

                                                                              // Load the document into Aspose.Note.
                                                                              Document oneFile = new Document(dataDir + "Aspose.one");

                                                                              dataDir = dataDir + "SaveToBinaryImageUsingFixedThreshold_out.png";

                                                                              // Save the document as gif.
                                                                              oneFile.Save(dataDir, new ImageSaveOptions(SaveFormat.Png)
                                                                                                        {
                                                                                                            ColorMode = ColorMode.BlackAndWhite,
                                                                                                            BinarizationOptions = new ImageBinarizationOptions()
                                                                                                                                      {
                                                                                                                                          BinarizationMethod = BinarizationMethod.FixedThreshold,
                                                                                                                                          BinarizationThreshold = 123
                                                                                                                                      }
                                                                                                        });