Java library and API for Image Processing

Create, load, manipulate or convert images without requiring any image editor.

  Download Free Trial
Aspose.Imaging for Java edit photo, edit image

Aspose.Imaging for Java

 

Aspose. Imaging for Java is a library offering advanced image processing features. You could easily create, load, manipulate, convert, compress images or photos using this API. 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.

 

Advanced Java Images Processing Library Features

 

 

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

 

Image deskew

 

Support animated multi-frame images

 

Uniform image page (frame) processing

 

Draw images using Graphics (graphics path and different geometric shapes)

 

Image masking

 

Memory optimization strategies

 

Draw text while controlling the font aspects

 

Save SVG with fonts embedded or exported

Image Format Conversion in an Easy Way

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.

Save the image in multiple formats - Java

// load document for conversion
Image img = Image.load(dir + "template.jpg");
// JPG to PSD Conversion
img.save(dir + "output.png", new PngOptions());
// 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);

Register Custom File Formats

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.

Edit photos

Aspose.Imaging provides ability to load, edit, process and save photos. Using library you can easily edit loaded photos, apply filters, manipulate them using Graphics and Paths. Using Aspose.Imaging, you can easily filter photos.

Compress images

Aspose.Imaging for .NET supports compressed vector images. They are vector images of the EMF, WMF, SVG formats compressed using a zip archiver. Their size averages from 30-70% of the original. This saves space on media and reduces file transfer time over the network.

Create image, manipulate and save it to disk

Using Aspose.Imaging for Java you can easily create images with specified parameters, manipulate them and save.

Create png image, manipulate it and save - Java

int width = 500;
int height = 300;

// Where created image to store
String path = "C:/createdImage.png";
// Create options
try (PngOptions options = new PngOptions())
{
	options.setSource(new FileCreateSource(path, false));

	try (PngImage image = (PngImage)Image.create(options, width, height))
	{          
		 // Create and initialize an instance of Graphics class 
		 // and Clear Graphics surface
		 Graphics graphic = new Graphics(image);
		 graphic.clear(Color.getGreen());
		 // Draw line on image
		 graphic.drawLine(new Pen(Color.getBlue()), 9, 9, 90, 90);

		 // Resize image
		 int newWidth = 400;
		 image.resizeWidthProportionally(newWidth, ResizeType.LanczosResample);  

		 // Crop the image to specified area
		com.aspose.imaging.Rectangle area = new com.aspose.imaging.Rectangle(10,10,200,200);
		image.crop(area);
	   
		image.save();
	}
};

Extract Data from TIFF Formats

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.

 

Support and Learning Resources

 
 

Aspose.Imaging offers individual Imaging APIs for other popular development environments as listed below: