Crop WMF or EMF

Hello readers, in this blog I would like to introduce you with new features included in Aspose.Imaging 19.6. The good thing about the Aspose team is that it releases both .NET and Java-based APIs simultaneously every month. This way both API users remain recurrent with changes being made in APIs every month.

In subsequent sections, I am going to give you a walkthrough of what new features have been included in API.

Crop EMF/WMF Images

Image cropping usually refers to the removal of the outer parts of an image to help improve the framing. Cropping may also be used to cut out some portion of an image to increase the focus on a particular area. The EmfImage\WmfImage class provides Crop method that accepts an instance of the Rectangle class. One can cut out any portion of an image by providing the desired boundaries to the Rectangle object.

The following examples demonstrate the cropping of a rectangular region in EMF and WMF images.

The similar Java-based implementation is like as under:

Drawing Raster Images on SVG, EMF, and WMF

Now, Aspose.Imaging supports drawing Raster(JPEG, GIF, TIFF, BMP) images to Vector (SVG, EMF, WMF) images. Raster images are based on pixels and thus lose clarity when scaled, while Vector-based images can be scaled indefinitely without degrading quality. Using Aspose.Imaging you can draw a raster or vector image on another vector image.

Adding Vector Image on another Vector Image

In the following example, I have shared the mechanism for adding a Vector image on another Vector image.

The similar Java based implementation is like as under:

Adding Raster Image on SVG

Using Aspose.Imaging, you can draw raster image on SVG. In following example, I have shared the mechanism for adding a raster image on another SVG image.

The similar Java based implementation is like as under:

Adding Raster Image on EMF

Using Aspose.Imaging, you can draw raster image on EMF. In following example, I have shared the mechanism for adding a raster image on another EMF image.

The similar Java based implementation is like as under:

Adding Raster Image on WMF

Using Aspose.Imaging, you can draw raster image on WMF. In following example, I have shared the mechanism for adding a raster image on another WMF image.

The similar Java based implementation is like as under:

Improved Image Processing

In this new release, we have improved the API performance in terms of adding support for multi-threading to manipulate the images along with options for optimizing memory usage during rendering

Image processing using multi-threading

Aspose.Imaging is multi-thread safe as long as only one thread works on a document at a time. It is a typical scenario to have one thread working on one document. In the following example, we have demonstrated the use of parallel DJVU images processing using multi-threading.

The similar Java-based implementation is like as under:

Optimizing Memory Usage

When reading a big PNG file, the total amount of RAM the process will take is always a concern. There are measures that can be adapted to cope with the challenge. Aspose.Imaging provides some relevant options and API calls to lower, reduce, and optimize memory use. Moreover, it can help the process work more efficiently and run faster.

The following example shows how to read a large PNG file in optimized mode.

The similar Java-based implementation is like as under:

Wait, there are many other features, enhancement, and bug fixes included in this release. Here you can get the detail!

When time allows you can check out API examples at Github, talk about this release and other API related issues in our forum.