0N/A<!
DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
0N/ACopyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. 0N/ADO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/AThis code is free software; you can redistribute it and/or modify it 0N/Aunder the terms of the GNU General Public License version 2 only, as 0N/Apublished by the Free Software Foundation. Sun designates this 0N/Aparticular file as subject to the "Classpath" exception as provided 0N/Aby Sun in the LICENSE file that accompanied this code. 0N/AThis code is distributed in the hope that it will be useful, but WITHOUT 0N/AANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/AFITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/Aversion 2 for more details (a copy is included in the LICENSE file that 0N/Aaccompanied this code). 0N/AYou should have received a copy of the GNU General Public License version 0N/A2 along with this work; if not, write to the Free Software Foundation, 0N/AInc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 0N/APlease contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 0N/ACA 95054 USA or visit www.sun.com if you need additional information or 0N/A<
body bgcolor="white">
0N/AThe main package of the Java Image I/O API.
0N/AMany common image I/O operations may be performed using the static
0N/Amethods of the <
code>ImageIO</
code> class.
0N/AThis package contains the basic classes and interfaces for describing
0N/Athe contents of image files, including metadata and thumbnails
0N/A(<
code>IIOImage</
code>); for controlling the image reading process
0N/A(<
code>ImageReader</
code>, <
code>ImageReadParam</
code>, and
0N/A<
code>ImageTypeSpecifier</
code>) and image writing process
0N/A(<
code>ImageWriter</
code> and <
code>ImageWriteParam</
code>); for
0N/Aperforming transcoding between formats (<
code>ImageTranscoder</
code>),
0N/Aand for reporting errors (<
code>IIOException</
code>).
0N/Aimage format plug-ins:
0N/A<
table border=1 align='center' cellpadding=5>
0N/A <
th> </
th> <
th>Reading</
th> <
th>Writing</
th>
0N/A <
th>Notes</
th> <
th>Metadata</
th>
0N/A <
td align='center'>yes</
td>
0N/A <
td align='center'>yes</
td>
0N/A <
td align='center'>none</
td>
0N/A JPEG metadata format</
a></
td>
0N/A <
td align='center'>yes</
td>
0N/A <
td align='center'>yes</
td>
0N/A <
td align='center'>none</
td>
0N/A PNG metadata format</
a></
td>
0N/A <
td align='center'>yes</
td>
0N/A <
td align='center'>yes</
td>
0N/A <
td align='center'>none</
td>
0N/A BMP metadata format</
a></
td>
0N/A <
td align='center'>yes</
td>
0N/A <
td align='center'>yes</
td>
0N/A <
td align='center'>none</
td>
0N/A WBMP metadata format</
a></
td>
0N/A <
td align='center'>yes</
td>
0N/A <
td align='center'>yes</
td>
0N/A <
td align='center'><
a href="#gif_plugin_notes">
0N/A GIF plug-in notes</
a></
td>
0N/A GIF metadata format</
a></
td>
0N/A<
h2> Standard Plug-in Notes</
h2>
0N/A<
h3><
a name="gif_plugin_notes">Standard plug-in for GIF image format</
a></
h3>
0N/AImageIO provides <
code>ImageReader</
code> and <
code>ImageWriter</
code>
0N/AGraphics Interchange Format (GIF)</
a> image format.
0N/AThese are the "standard" GIF plug-ins, meaning those that are included in the
0N/AJRE, as distinct from those included in standard extensions, or 3rd party
0N/Aplug-ins. The following notes and metadata specification apply to the
0N/A<
h3>Writing GIF images</
h3>
0N/A The GIF image writer plug-in guarantees lossless writing for images which meet
0N/A the following requirements:
0N/A<
li>the number of bands is 1;
0N/A<
li>the number of bits per sample is not greater than 8;
0N/A<
li>the size of a color component is not greater than 8;
0N/A By default the GIF writer plug-in creates version "89a" images. This can be
0N/A changed to "87a" by explicitly setting the version in the
0N/A stream metadata (see <
a 0N/A GIF Stream Metadata Format Specification</
a>).
0N/A<!-- animated images --> 0N/A The GIF writer plug-in supports the creation of animated GIF images through
0N/A the standard sequence writing methods defined in the
0N/A <
code>ImageWriter</
code> class.
0N/A <!-- TODO: add example here --> 0N/A<!-- color tables --> 0N/A A global color table is written to the output stream if one of the
0N/A following conditions is met:
0N/A <
li> stream metadata containing a GlobalColorTable element is
0N/A <
li> a sequence is being written and image metadata containing a
0N/A LocalColorTable element is supplied for the first image in the
0N/A <
li>image metadata is not supplied or does not contain a LocalColorTable
0N/A In the first case the global color table in the stream metadata is
0N/A used, in the second the local color table in the image metadata is
0N/A used, and in the third a global color table is created from the
0N/A ColorModel or SampleModel of the (first) image.
0N/A A local color table is written to the output stream only if image
0N/A metadata containing a LocalColorTable element is supplied to the
0N/A writer, or no image metadata is supplied to the writer and the local
0N/A color table which would be generated from the image itself is not
0N/A equal to the global color table.
0N/A A Graphic Control Extension block is written to the output stream only
0N/A if image metadata containing a GraphicControlExtension element is
0N/A supplied to the writer, or no image metadata is supplied and the
0N/A local color table generated from the image requires a transparent
0N/A index. Application, Plain Text, and Comment Extension blocks are
0N/A written only if they are supplied to the writer via image metadata.
0N/A <!-- writing interlaced images --> 0N/A The writing of interlaced images can be controlled by the progressive
0N/A mode of the provided <
code>ImageWriteParam</
code> instance.
0N/A If progressive mode is
0N/A <
code>MODE_DISABLED</
code> then a non-interlaced image will be written. If
0N/A progressive mode is <
code>MODE_DEFAULT</
code> then an interlaced image will
0N/A be written. If progressive mode is <
code>MODE_COPY_FROM_METADATA</
code>, then
0N/A the metadata setting is used (if it is provided, otherwise an interlaced
0N/A image will be written).
0N/A The GIF image writer plug-in supports setting output stream metadata from
0N/A metadata supplied to the writer in either the native GIF stream
0N/A javax_imageio_gif_stream_1.0 </
a> or the standard metadata format
0N/A javax_imageio_1.0</
a>, and setting
0N/A output image metadata from metadata supplied to the writer in either
0N/A javax_imageio_gif_image_1.0 </
a> or the standard metadata format
0N/A The mapping of standard metadata format to the GIF native stream and
0N/A image metadata formats is given in the tables <
a 0N/AJava<SUP><FONT SIZE="-2">TM</FONT></SUP> Image I/O API Specification 0N/APublic Draft 2 (specification version 0.5) 0N/ARelease: October 1, 2000