last modification time to current time codec.setModification(new GregorianCalendar( new SimpleTimeZone(0, "UTC"))); codec.process();
Supported storage order types
Loading
This codec reads both non-interlaced and Adam7 interlaced PNG files.
Saving
This codec only writes non-interlaced PNG files.
Supported color types
Loading
- Grayscale 1 bit streams are loaded as {@link net.sourceforge.jiu.data.BilevelImage} objects,2, 4 and 8 bit streams as {@link net.sourceforge.jiu.data.Gray8Image} and 16 bit as{@link net.sourceforge.jiu.data.Gray16Image} objects.
- Indexed 1, 2, 4 and 8 bit streams are all loaded as {@link net.sourceforge.jiu.data.Paletted8Image}.
- RGB truecolor 24 bit streams are loaded as {@link net.sourceforge.jiu.data.RGB24Image}, 48 bit streams as {@link net.sourceforge.jiu.data.RGB48Image} objects.
Saving
- {@link net.sourceforge.jiu.data.BilevelImage} objects are stored as grayscale 1 bit PNG streams.
- {@link net.sourceforge.jiu.data.Paletted8Image} objects are stored as indexed 8 bit PNG streams.Images will always be stored as 8 bit files, even if the palette has only 16, 4 or 2 entries.
- {@link net.sourceforge.jiu.data.Gray8Image} objects are stored as 8 bit grayscale PNG streams.
- {@link net.sourceforge.jiu.data.Gray16Image} objects are stored as 16 bit grayscale PNG streams.
- {@link net.sourceforge.jiu.data.RGB24Image} objects are stored as 24 bit RGB truecolor PNG streams.
- {@link net.sourceforge.jiu.data.RGB48Image} objects are stored as 48 bit RGB truecolor PNG streams.
Transparency information
PNG allows to store different types of transparency information. Full alpha channels, transparent index values, and more. Right now, this JIU codec does not make use of this information and simply skips over it when encountered.
Bounds
This codec regards the bounds concept. If bounds are specified with {@link #setBounds}, the codec will only load or save part of an image.
Metadata
Loading
- Physical resolution information is loaded from
pHYs
chunks. Use {@link #getDpiX} and {@link #getDpiY} to retrieve that information.after the call to {@link #process}. - Textual comments are read from
tEXt
chunks and can be retrieved with {@link #getComment} after the call to {@link #process}.
Saving
- Physical resolution information (specified with {@link #setDpi}) is stored in a
pHYs
chunk. - Textual comments (specified with {@link #appendComment}) are stored as
tEXt
chunks. The keyword used is Comment
. Each of the {@link #getNumComments} is stored in a chunk of its own. - Time of modification is stored in a
tIME
chunk. Use {@link #setModification(Calendar)} to give a point in time to this codec.
Implementation details
This class relies heavily on the Java runtime library for decompression and checksum creation.
Background
To learn more about the PNG file format, visit its
official homepage. There you can find a detailed specification, test images and existing PNG libraries and PNG-aware applications. The book
PNG - The Definitive Guide by Greg Roelofs, published by O'Reilly, 1999, ISBN 1-56592-542-4 is a valuable source of information on PNG. It is out of print, but it can be viewed online and downloaded for offline reading in its entirety from the site.
@author Marco Schmidt
@since 0.12.0