A robust .NET plugin designed to empower image compression with unparalleled options. This plugin not only excels in compressing images but also provides a spectrum of customization features tailored for optimizing photos.
Image
classImage.Save
method with an object of the image options classMetered metered = new Metered(); | |
metered.SetLicense("***********", // public key | |
"***********" // private key | |
); | |
// This code compresses png | |
using (var image = Image.Load("tiger.png")) | |
{ | |
image.Save("tiger_compressed.png", new PngOptions | |
{ | |
CompressionLevel = 9, | |
Progressive = true, | |
ColorType = PngColorType.IndexedColor, | |
Palette = ColorPaletteHelper.GetCloseImagePalette((RasterImage)image, 1 << 5) | |
}); | |
} |
Use efficient coding practices to enhance the performance of the image compression process.
To get started with image compression in .NET, ensure you have the necessary libraries installed and familiarize yourself with the API documentation provided by Aspose.
The Image Compressor supports various formats including JPEG, PNG, BMP, and GIF.
Ensure that the file path is correct and that the image format is supported.