C#.NET Java Library to Load and Save JPEG2000 and DjVu

Memory optimization is an important factor to be considered when performing any computation or processing on digital data. Different optimization strategies are applied to minimize memory utilization as well as processing delay. This is the reason we have implemented the feature of memory optimization for loading and creating the JPEG 2000 (JP2) and DjVu images in Aspose.Imaging for .NET and Java 19.12.

Memory Optimization for JPEG 2000 Images

Aspose.Imaging for .NET and Java APIs support working with JPEG 2000 images. You can load the existing JPEG 2000 images as well as create and save JPEG 2000 images specifying different Jpeg2000 Codec options in C# or Java. In order to optimize memory consumption when loading and saving JPEG 2000 images, you can define the memory optimization strategy and limit the memory buffer size to be used.

Let’s have a look at how to specify the memory buffer size when loading and creating JPEG 2000 images.

Load JPEG 2000 Image

You can specify the memory buffer size when loading a JPEG 2000 image using BufferSizeHint property in the LoadOptions class as shown in the following C# and Java code samples.

C#

Java

Create or Save JPEG 2000 Image

Similar to the loading of JPEG 2000 images, you can specify memory buffer size when creating or saving the images using BufferSizeHint property in Jpeg2000Options class.

C#

Java

Memory Optimization for DjVu Images

Aspose.Imaging for .NET and Java APIs also support working with DjVu images. You can load a DjVu image and perform the conversion from DjVu to raster image formats such as TIFF, PNG, etc. Similar to JEPG 2000 images, you can optimize memory utilization when loading a DjVu image as shown in the following C# and Java code samples.

C#

Java

Well, you have seen that how to limit the memory buffer size when loading or creating JP2 or DjVu images using Aspose.Imaging. So, if you are working with JPEG 2000 and DjVu images and want to optimize the memory consumption, we recommend you to download and use Aspose.Imaging 19.12 within your .NET or Java applications.

As always, if you would have any questions or queries, do let us know via our forum.