This article guides on how to create multipage TIFF using Java. It has details to set the IDE for merging images, a list of steps, and a sample code to combine multiple TIFF files into one using Java. It will provide details to handle normal and TIFF input files containing multiple pages.
Steps to Combine TIFF Files using Java
- Set the IDE to use Aspose.Imaging for Java to merge multiple images into a TIFF file
- Define the temp folder, source folder, output TIFF file name and fetch image names from the source directory
- Filter files of desired image types and sort them alphabetically if required
- Process each image and add it to the raster images collection
- If the input image is TIFF, parse through each page in the TIFF and add it as a separate image in the collection
- Parse through all the images in the collection and create the TIFF file
- Dispose of all the frames and clean the temporary images
These steps explain how to merge TIFF files into one using Java. Define the source folder, output the TIFF file name, filter the source image file names and parse through all the images in the collection. Add each image in the output TIFF except input TIFF files, parse through each page in the TIFF file for adding as a separate image, and create the resultant TIFF file by merging these items.
Code to Combine TIFF Files Into One using Java
This sample code has demonstrated how to merge TIFF file using Java. This code adds all the pages from the input TIFF file; however, if you add the TIFF file as a normal image, it will add only the first page of the input TIFF file. You can also filter images by using the LoadOptions class object while loading the image for merging.
In this article, we have learned to combine images into a TIFF file. To blur pictures, refer to the article on Blur image in Java.