Enum ColorMode
Enum ColorMode
Namespace: Aspose.Note.Saving
Assembly: Aspose.Note.dll (25.6.0)
The color mode of the image.
public enum ColorMode
{
Automatic,
RGB,
CMYK,
Lab,
Grayscale,
Indexed
}
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.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
Document oneFile = new Document(dataDir + "Aspose.one");
dataDir += @"\SaveAsGrayscaleImage_out.png";
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.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
Document oneFile = new Document(Path.Combine(dataDir, "Aspose.one"));
var dst = Path.Combine(dataDir, "SaveToTiffUsingCcitt3Compression.tiff");
oneFile.Save(dst, new ImageSaveOptions()
{
SaveFormat = SaveFormat.Tiff,
ColorMode = ColorMode.BlackAndWhite,
TiffCompression = TiffCompression.Ccitt3
});
Shows how to save a document as binary image using Otsu’s method.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
Document oneFile = new Document(dataDir + "Aspose.one");
string dataDir_1 = dataDir + "SaveToBinaryImageUsingOtsuMethod_out.png";
oneFile.Save(dataDir_1,
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.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
Document oneFile = new Document(dataDir + "Aspose.one");
dataDir += "SaveToBinaryImageUsingFixedThreshold_out.png";
oneFile.Save(dataDir,
new ImageSaveOptions(SaveFormat.Png)
{
ColorMode = ColorMode.BlackAndWhite,
BinarizationOptions = new ImageBinarizationOptions()
{
BinarizationMethod = BinarizationMethod.FixedThreshold,
BinarizationThreshold = 123
}
});