Enum DitheringMethod
Enum DitheringMethod
이름 공간 : Aspose.Imaging 모임: Aspose.Imaging.dll (25.4.0)
말하는 방법입니다.
public enum DitheringMethod
Fields
FloydSteinbergDithering = 1
더 복잡한 디팅 알고리즘은 가장 가까운 이웃의 강도 값을 사용합니다.
ThresholdDithering = 0
가장 간단하고 빠른 디트링 알고리즘.
Examples
다음 예제는 라스터 이미지를 충전하고 다른 팔레트 깊이를 사용하여 경계 및 흐름 디트링을 수행합니다.
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.png"))
{
Aspose.Imaging.RasterImage rasterImage = (Aspose.Imaging.RasterImage)image;
// Perform threshold dithering using 4-bit color palette which contains 16 colors.
// The more bits specified the higher quality and the bigger size of the output image.
// Note that only 1-bit, 4-bit and 8-bit palettes are supported at the moment.
rasterImage.Dither(Aspose.Imaging.DitheringMethod.ThresholdDithering, 4);
rasterImage.Save(dir + "sample.ThresholdDithering4.png");
}
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.png"))
{
Aspose.Imaging.RasterImage rasterImage = (Aspose.Imaging.RasterImage)image;
// Perform floyd dithering using 1-bit color palette which contains only 2 colors - black and white.
// The more bits specified the higher quality and the bigger size of the output image.
// Note that only 1-bit, 4-bit and 8-bit palettes are supported at the moment.
rasterImage.Dither(Aspose.Imaging.DitheringMethod.FloydSteinbergDithering, 1);
rasterImage.Save(dir + "sample.FloydSteinbergDithering1.png");
}