In this simple topic, you’ll learn how to convert JPG to JPEG2000 with NET REST API. We will develop a JPG to JPEG2000 converter with C# Low Code API by following to the comprehensive steps mentioned in the following sections. The created application can be used with any .NET application supported in macOS, Windows, or Linux environments and conversion can be done for free.
Prerequisite
- Create an account and get API credentials to perform JPG to JPEG2000 conversion
- Download Aspose.Imaging Cloud SDK for .NET to convert JPG to JPEG2000
- Setup C# .NET project with the above SDK to render a JPG as JPEG2000
Steps to Convert JPG to JPEG2000 with NET REST API
- Set the Client ID and Client Secret for the API to convert JPG to JPEG2000
- Create an instance of the ImagingAPI class with client credentials to perform JPG to JPEG2000 conversion
- Specify the source JPG and output JPEG2000 file names
- Access and load the source JPG file and upload it to cloud storage
- Create an instance of the ConvertImageRequest with input JPG file stream and output JPEG2000 format
- Call the ConvertImage method to convert JPG to JPEG2000 with NET REST API
- Save the returned JPEG2000 file stream on the local disk
The simple steps entail exporting the file type from JPG to JPEG2000 with C# Low Code API. We will commence with the initialization of the SDK by using an instance of the ImagingAPI class. We will then access the source JPG file using a FileStream from the disk and then by using a ConvertImageRequest class instance perform the conversion to a JPEG2000 using the ConvertImage() method.
Code for JPG to JPEG2000 Conversion in NET Low Code API
This crisp example code demonstrates how to convert JPG to JPEG2000 with C# Cloud API. After addressing the required pre-requisite steps, you have to provide a path to access the source JPG image on the disk and by using the Aspose.Imaging REST API SDK performs the rendering to JPEG2000. The resultant JPEG2000 image file stream is received as a response after the conversion is completed and you can then save it locally on the disk.
In this topic, we have learned to transform JPG to JPEG2000 with Cloud API. If you are interested in performing GIF to JPEG2000 conversion, refer to the article on how to Convert GIF to JPEG2000 with NET REST API.