com.asprise.util.tiff
Class TIFFWriter

java.lang.Object
  extended bycom.asprise.util.tiff.TIFFWriter

public class TIFFWriter
extends java.lang.Object

A utility class to create TIFF files with image conversion abilities.


Field Summary
static int preferredResolution
          The preferred resolution - use 0 for default
static boolean reverseColorDuringConversion
          Should colors be reversed during conversion?
static int TIFF_COMPRESSION_DEFLATE
          Zip in TIFF compression (lossless).
static int TIFF_COMPRESSION_GROUP3_1D
          CCITT run length encoding.
static int TIFF_COMPRESSION_GROUP3_2D
          CCITT T.4 compression for bilevel only.
static int TIFF_COMPRESSION_GROUP4
          CCITT T.6 compression for bilevel only.
static int TIFF_COMPRESSION_NONE
          Indicates no compression.
static int TIFF_COMPRESSION_PACKBITS
          byte-oriented 'packbits' compression.
static int TIFF_CONVERSION_NONE
          Do not convert images.
static int TIFF_CONVERSION_TO_BLACK_WHITE
          Converts images into black white.
static int TIFF_CONVERSION_TO_GRAY
          Converts images into gray.
 
Constructor Summary
TIFFWriter()
           
 
Method Summary
static void createTIFFFromImages(java.awt.image.BufferedImage[] images, java.io.File file)
          Creates a TIFF file from the specified images. all the images are converted to black-white and GROUP4 compression is used for the TIFF.
static void createTIFFFromImages(java.awt.image.BufferedImage[] images, int conversion, int compression, java.io.File file)
          Creates a TIFF file from the specified images.
static java.awt.image.BufferedImage getBufferedImageFromImage(java.awt.Image image)
          Converts an image into a buffered image.
static void main(java.lang.String[] args)
          Simply console utility tool to create TIFF file from image files.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TIFF_COMPRESSION_NONE

public static final int TIFF_COMPRESSION_NONE
Indicates no compression.


TIFF_COMPRESSION_PACKBITS

public static final int TIFF_COMPRESSION_PACKBITS
byte-oriented 'packbits' compression.


TIFF_COMPRESSION_GROUP3_1D

public static final int TIFF_COMPRESSION_GROUP3_1D
CCITT run length encoding.


TIFF_COMPRESSION_GROUP3_2D

public static final int TIFF_COMPRESSION_GROUP3_2D
CCITT T.4 compression for bilevel only.


TIFF_COMPRESSION_GROUP4

public static final int TIFF_COMPRESSION_GROUP4
CCITT T.6 compression for bilevel only.


TIFF_COMPRESSION_DEFLATE

public static final int TIFF_COMPRESSION_DEFLATE
Zip in TIFF compression (lossless).


TIFF_CONVERSION_TO_BLACK_WHITE

public static final int TIFF_CONVERSION_TO_BLACK_WHITE
Converts images into black white.

See Also:
Constant Field Values

TIFF_CONVERSION_TO_GRAY

public static final int TIFF_CONVERSION_TO_GRAY
Converts images into gray.

See Also:
Constant Field Values

TIFF_CONVERSION_NONE

public static final int TIFF_CONVERSION_NONE
Do not convert images.

See Also:
Constant Field Values

reverseColorDuringConversion

public static boolean reverseColorDuringConversion
Should colors be reversed during conversion?


preferredResolution

public static int preferredResolution
The preferred resolution - use 0 for default

Constructor Detail

TIFFWriter

public TIFFWriter()
Method Detail

createTIFFFromImages

public static void createTIFFFromImages(java.awt.image.BufferedImage[] images,
                                        java.io.File file)
                                 throws java.io.IOException
Creates a TIFF file from the specified images. all the images are converted to black-white and GROUP4 compression is used for the TIFF.

Parameters:
images -
file -
Throws:
java.io.IOException

createTIFFFromImages

public static void createTIFFFromImages(java.awt.image.BufferedImage[] images,
                                        int conversion,
                                        int compression,
                                        java.io.File file)
                                 throws java.io.IOException
Creates a TIFF file from the specified images. Before the images are put into the TIFF, you can optionally convert them to gray (TIFF_CONVERSION_TO_GRAY) or black-white (TIFF_CONVERSION_TO_BLACK_WHITE) to reduce the file size. Also, you can set the compression algorithm for TIFF.

Parameters:
images - - list of images to be put into the TIFF file.
conversion - - converts the images into the specified format before putting into the TIFF.
compression - - compression algorithm used for TIFF.
file - - the TIFF file to be written to.
Throws:
java.io.IOException

getBufferedImageFromImage

public static java.awt.image.BufferedImage getBufferedImageFromImage(java.awt.Image image)
Converts an image into a buffered image.

Parameters:
image -
Returns:

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Simply console utility tool to create TIFF file from image files. Usage: java com.asprise.util.tiff.TIFFWriter [tiff file to be created] [image conversion option, set -1 to use default] [TIFF compression option, set -1 to use default] [path of image1] [path of image2] ...

Parameters:
args -
Throws:
java.io.IOException