Enum DitheringMethod
Enum DitheringMethod
Το όνομα: Aspose.Imaging Συγκέντρωση: Aspose.Imaging.dll (25.4.0)
Η μέθοδος της κήρυξης.
public enum DitheringMethod
Fields
FloydSteinbergDithering = 1
Ένα πιο σύνθετο αλγόριθμο διτρήσεων, χρησιμοποιεί τις τιμές έντασης των πλησιέστερων γειτόνων.
ThresholdDithering = 0
Ο πιο απλός και ταχύτερος αλγόριθμος.
Examples
Το παρακάτω παράδειγμα φορτώνει μια εικόνα ράστερ και εκτελεί το όριο και το κολύμπι dithering χρησιμοποιώντας διαφορετική βάθος παλέτας.
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");
}