Aspose. Imaging for Java is a library offering advanced image processing features. Developers can create, edit or convert images in their own application. Also Aspose. Imaging library supports drawing and work with graphic primitives. Image export and conversion (including uniform multi-page image processing) is the one of API core features along with image transformations (resize, crop, flip&rotate, binarization, grayscale, adjust), advanced image manipulation features (filtering, dithering, masking, deskewing) and memory optimization strategies.
Aspose.Imaging for Java is a flexible, stable and powerful API, capable of processing the most commonly used formats along with some special formats such as DjVu, DICOM, WebP & DNG.
An overview of the images manipulation library.
Aspose.Imaging for Java supports the JDK 1.6 and above.
Aspose.Imaging for Java supports a wide range of conventional & special image file formats.
Create, load & edit images
Convert images to a variety of formats
Various image filters and effects (gaussian, blur, median, grayscale, binarization, dithering etc)
Crop, resize & rotate-flip
Support animated multi-frame images
Uniform image page (frame) processing
Draw images using Graphics (graphics path and different geometric shapes)
Memory optimization strategies
Draw text while controlling the font aspects
Save SVG with fonts embedded or exported
Aspose.Imaging for Java API provides an array of advanced algorithms encapsulated by specialized classes for format conversion. These classes can convert images to conventional raster formats as well as to PSD, SVG, DjVu, DICOM, WMF, EMF, DNG, & WebP formats and are simple to use.
// load document for conversion Image img = Image.load(dir + "template.jpg"); // JPG to PSD Conversion img.save(dir + "output.psd", new PsdOptions()); // JPG to TIFF format img.save(dir + "output.tiff", new TiffOptions(TiffExpectedFormat.Default)); // convert jpg to SVG format SvgOptions svgOptions = new SvgOptions(); SvgRasterizationOptions svgRasterizationOptions = new SvgRasterizationOptions(); svgRasterizationOptions.setPageWidth(img.getWidth()); svgRasterizationOptions.setPageHeight(img.getHeight()); svgOptions.setVectorRasterizationOptions(svgRasterizationOptions); img.save(dir + "output.svg", svgOptions);
Another promising feature that Aspose.Imaging for Java API provides is to register custom formats. The library allows the developers to register new custom file formats to create, open or export to by using one of Aspose.Imaging for Java registry APIs for the corresponding operation. This feature allows the addition of new file formats that can be used for drawing and export purposes.
Grayscaling is the process of converting a continuous-tone image to an image with discontinues gray shades. With Aspose.Imaging, converting any image to its grayscale representation is as simple as calling a single method on the supplied RasterImage.
// load the file to be transformed Image img = Image.load(dir + "template.png"); // cast to RasterCachedImage RasterImage rasterImage = (RasterImage) img; // transform to its grayscale representation rasterImage.grayscale(); // save the resultant image rasterImage.save(dir + "output.png");
The image processing library allows data recovery from broken TIFF with some loss. API loads TIFF file having corrupted data strips or improper data layout and replaces corrupted data with some color. Developers can further process the resultant image without experiencing errors using the API.