public class ImageIOHelper extends Object
Constructor and Description |
---|
ImageIOHelper() |
Modifier and Type | Method and Description |
---|---|
static ByteBuffer |
convertImageData(BufferedImage bi)
Converts
BufferedImage to ByteBuffer . |
static List<File> |
createTiffFiles(File imageFile,
int index)
Creates a list of TIFF image files from an image file.
|
static List<File> |
createTiffFiles(File imageFile,
int index,
boolean preserve)
Creates a list of TIFF image files from an image file.
|
static List<File> |
createTiffFiles(List<IIOImage> imageList,
int index)
Creates a list of TIFF image files from a list of
IIOImage
objects. |
static List<File> |
createTiffFiles(List<IIOImage> imageList,
int index,
int dpiX,
int dpiY) |
static List<IIOImage> |
getIIOImageList(BufferedImage bi)
Gets a list of
IIOImage objects for a
BufferedImage . |
static List<IIOImage> |
getIIOImageList(File imageFile)
Gets a list of
IIOImage objects for an image file. |
static ByteBuffer |
getImageByteBuffer(IIOImage image)
Gets pixel data of an
IIOImage object. |
static ByteBuffer |
getImageByteBuffer(RenderedImage image)
Gets pixel data of an
RenderedImage object. |
static List<BufferedImage> |
getImageList(File imageFile)
Gets a list of
BufferedImage objects for an image file. |
static void |
mergeTiff(BufferedImage[] inputImages,
File outputTiff)
Merges multiple images into one multi-page TIFF image.
|
static void |
mergeTiff(BufferedImage[] inputImages,
File outputTiff,
String compressionType)
Merges multiple images into one multi-page TIFF image.
|
static void |
mergeTiff(File[] inputImages,
File outputTiff)
Merges multiple images into one multi-page TIFF image.
|
static void |
mergeTiff(List<IIOImage> imageList,
File outputTiff)
Merges multiple images into one multi-page TIFF image.
|
static void |
mergeTiff(List<IIOImage> imageList,
File outputTiff,
String compressionType)
Merges multiple images into one multi-page TIFF image.
|
static Map<String,String> |
readImageData(IIOImage oimage)
Reads image meta data.
|
public static List<File> createTiffFiles(File imageFile, int index) throws IOException
imageFile
- input image fileindex
- an index of the page; -1 means all pages, as in a multi-page
TIFF imageIOException
public static List<File> createTiffFiles(File imageFile, int index, boolean preserve) throws IOException
imageFile
- input image fileindex
- an index of the page; -1 means all pages, as in a multi-page
TIFF imagepreserve
- preserve compression modeIOException
public static List<File> createTiffFiles(List<IIOImage> imageList, int index) throws IOException
IIOImage
objects.imageList
- a list of IIOImage
objectsindex
- an index of the page; -1 means all pagesIOException
public static List<File> createTiffFiles(List<IIOImage> imageList, int index, int dpiX, int dpiY) throws IOException
IOException
public static ByteBuffer getImageByteBuffer(IIOImage image) throws IOException
IIOImage
object.image
- an IIOImage
objectIOException
public static ByteBuffer getImageByteBuffer(RenderedImage image) throws IOException
RenderedImage
object.image
- an RenderedImage
objectIOException
public static ByteBuffer convertImageData(BufferedImage bi)
BufferedImage
to ByteBuffer
.bi
- Input imagepublic static List<BufferedImage> getImageList(File imageFile) throws IOException
BufferedImage
objects for an image file.imageFile
- input image file. It can be any of the supported
formats, including TIFF, JPEG, GIF, PNG, BMP, JPEGBufferedImage
objectsIOException
public static List<IIOImage> getIIOImageList(File imageFile) throws IOException
IIOImage
objects for an image file.imageFile
- input image file. It can be any of the supported
formats, including TIFF, JPEG, GIF, PNG, BMP, JPEG, and PDF if GPL
Ghostscript is installedIIOImage
objectsIOException
public static List<IIOImage> getIIOImageList(BufferedImage bi) throws IOException
IIOImage
objects for a
BufferedImage
.bi
- input imageIIOImage
objectsIOException
public static void mergeTiff(File[] inputImages, File outputTiff) throws IOException
inputImages
- an array of image filesoutputTiff
- the output multi-page TIFF fileIOException
public static void mergeTiff(BufferedImage[] inputImages, File outputTiff) throws IOException
inputImages
- an array of BufferedImage
outputTiff
- the output TIFF fileIOException
public static void mergeTiff(BufferedImage[] inputImages, File outputTiff, String compressionType) throws IOException
inputImages
- an array of BufferedImage
outputTiff
- the output TIFF filecompressionType
- valid values: LZW, CCITT T.6, PackBitsIOException
public static void mergeTiff(List<IIOImage> imageList, File outputTiff) throws IOException
imageList
- a list of IIOImage
objectsoutputTiff
- the output TIFF fileIOException
public static void mergeTiff(List<IIOImage> imageList, File outputTiff, String compressionType) throws IOException
imageList
- a list of IIOImage
objectsoutputTiff
- the output TIFF filecompressionType
- valid values: LZW, CCITT T.6, PackBitsIOException
Copyright © 2017 Tess4J. All Rights Reserved.