Convert PNG Images to JPG in C#

Convert PNG images to JPG in C#

You may often need to convert images from one format to another depending upon different scenarios. PNG to JPG is among the widely performed image conversions, which is commonly used to shrink image size. To automate this conversion from within the .NET applications, this article shows how to convert a PNG image to JPG programmatically in C#.

C# .NET API for PNG to JPG Conversion

To convert PNG images to JPG format, we will use Aspose.Imaging for .NET. It is a powerful image processing API that supports the manipulation of a wide range of image formats. Furthermore, its easy-to-use image converter lets you convert images from one format to another without degrading their quality. You can either download the API’s DLL or install it directly from NuGet.

PM> Install-Package Aspose.Imaging

Convert a PNG Image to JPG in C#

Aspose.Imaging for .NET doesn’t involve any complex operations to perform PNG to JPG conversion. Simply, you need to load the PNG image and save it in JPG format. So let’s see how to convert a PNG image to JPG in C#.

The following code sample shows how to convert a PNG image to JPG format in .NET applications.

Get a Free API License

You can get a free temporary license to use Aspose.Imaging for .NET without evaluation limitations.

Conclusion

In this article, you have learned how to convert PNG images to JPG in C#. You can simply install the said API and integrate provided code sample to automate PNG to JPG conversion from within your .NET applications. In addition, you can explore more about the .NET image processing API using documentation. Also, you can post your queries on our forum.

See Also