Learn how to:
- convert PNG images to JPG in C#: https://blog.aspose.com/2021/12/14/convert-png-to-jpg-in-csharp/
- convert JPG images to PNG in C#: https://blog.aspose.com/2021/11/15/convert-jpg-to-png-in-csharp/
Learn how to:
// Load JPG image | |
using (Image image = Image.Load("aspose.jpg")) | |
{ | |
// Create PNG options | |
PngOptions options = new PngOptions() { ColorType= FileFormats.Png.PngColorType.TruecolorWithAlpha }; | |
// Save image as JPG | |
image.Save("JPG-to-PNG.png", options); | |
} |
// Load PNG image | |
using (Image image = Image.Load("aspose.png")) | |
{ | |
// Save image as JPG | |
image.Save("PNG-to-JPG.jpg", new JpegOptions()); | |
} |