DitheringMethod
İçindekiler
[
Saklamak
]Inheritance: java.lang.Object, com.aspose.ms.System.ValueType, com.aspose.ms.System.Enum
public final class DitheringMethod extends System.Enum
Titreme yöntemi.
Alanlar
| Alan | Açıklama |
|---|---|
| ThresholdDithering | Eşik dithering. |
| FloydSteinbergDithering | Floyd-Steinberg dithering. |
Example: The following example loads a raster image and performs threshold and floyd dithering using different palette depth.
String dir = "c:\\temp\\";
com.aspose.imaging.Image image = com.aspose.imaging.Image.load(dir + "sample.png");
try {
com.aspose.imaging.RasterImage rasterImage = (com.aspose.imaging.RasterImage) image;
// 16 renk içeren 4-bit renk paleti kullanarak eşik dithering uygulayın.
// Daha fazla bit belirtildiğinde çıktı görüntüsünün kalitesi daha yüksek ve boyutu daha büyük olur.
// Şu anda yalnızca 1-bit, 4-bit ve 8-bit paletlerin desteklendiğini unutmayın.
rasterImage.dither(com.aspose.imaging.DitheringMethod.ThresholdDithering, 4);
rasterImage.save(dir + "sample.ThresholdDithering4.png");
} finally {
image.dispose();
}
image = com.aspose.imaging.Image.load(dir + "sample.png");
try {
com.aspose.imaging.RasterImage rasterImage = (com.aspose.imaging.RasterImage) image;
// Sadece 2 renk (siyah ve beyaz) içeren 1-bit renk paleti kullanarak Floyd dithering uygulayın.
// Daha fazla bit belirtildiğinde çıktı görüntüsünün kalitesi daha yüksek ve boyutu daha büyük olur.
// Şu anda yalnızca 1-bit, 4-bit ve 8-bit paletlerin desteklendiğini unutmayın.
rasterImage.dither(com.aspose.imaging.DitheringMethod.FloydSteinbergDithering, 1);
rasterImage.save(dir + "sample.FloydSteinbergDithering1.png");
} finally {
image.dispose();
}
ThresholdDithering
public static final int ThresholdDithering
Eşik dithering. En basit ve en hızlı dithering algoritması.
FloydSteinbergDithering
public static final int FloydSteinbergDithering
Floyd-Steinberg dithering’i. Daha karmaşık bir dithering algoritması, en yakın komşu yoğunluk değerlerini kullanır.