Mudassir Khan July 8, 20190 Comments

WMF/EMF cropping and adding Raster image to Vector image support available in Aspose.Imaging

WMF/EMF cropping and adding Raster image to Vector image support available in Aspose.Imaging

July 8, 2019
Share on FacebookTweet about this on TwitterShare on LinkedIn

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

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

Cropping 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 for 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 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 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 optimize 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 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 adopted 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’s 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.

Leave a comment

Posted inAspose.Imaging Product Family
 

Related Articles