Grayscale

GifImage.Grayscale method

将图像转换为其灰度表示

public override void Grayscale()

例子

以下示例将彩色 GIF 图像转换为其灰度表示。灰度图像仅由灰度阴影组成,仅携带强度信息。

[C#]

string dir = "c:\\temp\\";

using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.gif"))
{
    Aspose.Imaging.FileFormats.Gif.GifImage gifImage = (Aspose.Imaging.FileFormats.Gif.GifImage)image;

    gifImage.Grayscale();
    gifImage.Save(dir + "sample.Grayscale.png", new Aspose.Imaging.ImageOptions.PngOptions());
}

也可以看看