1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
   2 <html>
   3 <head>



   4 <!--
   5 Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
   6 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   7 
   8 This code is free software; you can redistribute it and/or modify it
   9 under the terms of the GNU General Public License version 2 only, as
  10 published by the Free Software Foundation.  Oracle designates this
  11 particular file as subject to the "Classpath" exception as provided
  12 by Oracle in the LICENSE file that accompanied this code.
  13 
  14 This code is distributed in the hope that it will be useful, but WITHOUT
  15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  16 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  17 version 2 for more details (a copy is included in the LICENSE file that
  18 accompanied this code).
  19 
  20 You should have received a copy of the GNU General Public License version
  21 2 along with this work; if not, write to the Free Software Foundation,
  22 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  23 
  24 Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  25 or visit www.oracle.com if you need additional information or have any
  26 questions.
  27 -->
  28 
  29 <title>PNG Metadata Format Specification</title>
  30 </head>
  31 
  32 <body bgcolor="white">
  33 
  34 <center><h1>
  35 PNG Metadata Format Specification
  36 </h1></center>
  37 
  38 <p>
  39 
  40 The PNG native format encodes the complete contents of a PNG file
  41 chunk by chunk, except for the IDAT chunks that contain the actual
  42 image data.  Chunks that are not defined in the PNG 1.2 specification
  43 are stored under the <code>UnknownChunks</code> element.  Note that it
  44 is the responsibility of application software to implement the rules
  45 for PNG readers, writers, and editors (<i>e.g.</i>, the rules
  46 concerning unsafe-to-copy chunks) described in the PNG specification.
  47 The Image I/O library is not, in and of itself, a PNG reader, writer,
  48 or editor in the sense of the specification.  Rather, it is a tool
  49 that may be used to build PNG readers, writers, and editors.
  50 
  51 <p>
  52 
  53 The image's actual width, height, bit depth, and color type will
  54 override any values passed to the writer via metadata, with one
  55 exception.  If the image has an <code>IndexColorModel</code>, the
  56 color table entries will be checked to determine if they form a
  57 uniform grayscale ramp. If so, the image will normally be encoded
  58 using as grayscale instead of palette color.  However, if the color
  59 type set in the metadata is "Palette", palette color will be used.
  60 
  61 <p>
  62  
  63 If no metadata is supplied when encoding an image, the header is
  64 initialized from the image being encoded, and no optional chunks are
  65 included.
  66 
  67 <p>
  68 
  69 The semantics of the standard chunks are described in the <A
  70 HREF="http://www.libpng.org/pub/png/spec/">PNG specification</A>.
  71 Note that there are some restrictions on which chunks may appear
  72 for each color type. In particular,
  73 
  74 <ul>
  75   <li>A <code>PLTE</code> chunk may not appear in a <code>Gray</code>
  76 or <code>GrayAlpha</code> image
  77 
  78   <li><code>hIST</code> and <code>tRNS</code> chunks require a prior
  79 <code>PLTE</code> chunk
  80 
  81   <li>A <code>tRNS</code> chunk may not appear in
  82 <code>GrayAlpha</code> and <code>RGBA</code> images
  83 </ul>
  84 
  85 The child nodes of the <code>bKGD</code>, <code>sBIT</code>, and
  86 <code>tRNS</code> chunks must match the image's color type.
  87 
  88 <p> 
  89 
  90 Certain chunks may meaningfully appear multiple times in a PNG file,
  91 in particular the text-related chunks.  In order to simplify the
  92 metadata format, multiple instances of these chunks are consolidated
  93 under a single parent node (<i>e.g.</i>, the <code>tEXt</code> node),
  94 which may have zero or more children (<i>e.g.</i>,
  95 <code>tEXtEntry</code> nodes).  If no children are present, no chunk
  96 will be written.  Similarly, unknown chunks are stored as children of
  97 a single <code>UnknownChunks</code> node.
  98 
  99 <p>
 100 
 101 It is not possible to control the ordering of the chunks as they are
 102 written, or to determine the order of the chunks in a file being read.
 103 
 104 <pre>
 105 &lt;!DOCTYPE "javax_imageio_png_1.0" [
 106 
 107   &lt;!ELEMENT "javax_imageio_png_1.0" (IHDR?, PLTE?, bKGD?, cHRM?, 
 108     gAMA?, hIST?, iCCP?, iTXt?, pHYS?, sBIT?, sPLT?, sRGB?, tEXt?, 
 109     tIME?, tRNS?, zTXt?, UnknownChunks?)&gt;
 110 
 111     &lt;!ELEMENT "IHDR" EMPTY&gt;
 112       &lt;!-- The IHDR chunk, containing the header --&gt;
 113       &lt;!ATTLIST "IHDR" "width" #CDATA #REQUIRED&gt;
 114         &lt;!-- The width of the image in pixels --&gt;
 115         &lt;!-- Data type: Integer --&gt;
 116         &lt;!-- Min value: 1 (inclusive) --&gt;
 117         &lt;!-- Max value: 2147483647 (inclusive) --&gt;
 118       &lt;!ATTLIST "IHDR" "height" #CDATA #REQUIRED&gt;
 119         &lt;!-- The height of the image in pixels --&gt;
 120         &lt;!-- Data type: Integer --&gt;
 121         &lt;!-- Min value: 1 (inclusive) --&gt;
 122         &lt;!-- Max value: 2147483647 (inclusive) --&gt;
 123       &lt;!ATTLIST "IHDR" "bitDepth" ("1" | "2" | "4" | "8" | "16")
 124          #REQUIRED&gt;
 125         &lt;!-- The bit depth of the image samples --&gt;
 126       &lt;!ATTLIST "IHDR" "colorType" ("Grayscale" | "RGB" | "Palette" | 
 127         "GrayAlpha" | "RGBAlpha") #REQUIRED&gt;
 128         &lt;!-- The color type of the image --&gt;
 129       &lt;!ATTLIST "IHDR" "compressionMethod" ("deflate") #REQUIRED&gt;
 130         &lt;!-- The compression used for image data, always "deflate" --&gt;
 131       &lt;!ATTLIST "IHDR" "filterMethod" ("adaptive") #REQUIRED&gt;
 132         &lt;!-- The filtering method used for compression, always "adaptive" --&gt;
 133       &lt;!ATTLIST "IHDR" "interlaceMethod" ("none" | "adam7") #REQUIRED&gt;
 134         &lt;!-- The interlacing method, "none" or "adam7" --&gt;
 135 
 136     &lt;!ELEMENT "PLTE" (PLTEEntry)*&gt;
 137       &lt;!-- The PLTE chunk, containing the palette --&gt;
 138       &lt;!-- Min children: 1 --&gt;
 139       &lt;!-- Max children: 256 --&gt;
 140 
 141       &lt;!ELEMENT "PLTEEntry" EMPTY&gt;
 142         &lt;!-- A palette entry --&gt;
 143         &lt;!ATTLIST "PLTEEntry" "index" #CDATA #REQUIRED&gt;
 144           &lt;!-- The index of a palette entry --&gt;
 145           &lt;!-- Data type: Integer --&gt;
 146           &lt;!-- Min value: 0 (inclusive) --&gt;
 147           &lt;!-- Max value: 255 (inclusive) --&gt;
 148         &lt;!ATTLIST "PLTEEntry" "red" #CDATA #REQUIRED&gt;
 149           &lt;!-- The red value of a palette entry --&gt;
 150           &lt;!-- Data type: Integer --&gt;
 151           &lt;!-- Min value: 0 (inclusive) --&gt;
 152           &lt;!-- Max value: 255 (inclusive) --&gt;
 153         &lt;!ATTLIST "PLTEEntry" "green" #CDATA #REQUIRED&gt;
 154           &lt;!-- The green value of a palette entry --&gt;
 155           &lt;!-- Data type: Integer --&gt;
 156           &lt;!-- Min value: 0 (inclusive) --&gt;
 157           &lt;!-- Max value: 255 (inclusive) --&gt;
 158         &lt;!ATTLIST "PLTEEntry" "blue" #CDATA #REQUIRED&gt;
 159           &lt;!-- The blue value of a palette entry --&gt;
 160           &lt;!-- Data type: Integer --&gt;
 161           &lt;!-- Min value: 0 (inclusive) --&gt;
 162           &lt;!-- Max value: 255 (inclusive) --&gt;
 163 
 164     &lt;!ELEMENT "bKGD" (bKGD_Grayscale | bKGD_RGB | bKGD_Palette)&gt;
 165       &lt;!-- The bKGD chunk, containing the background color --&gt;
 166 
 167       &lt;!ELEMENT "bKGD_Grayscale" EMPTY&gt;
 168         &lt;!-- A grayscale background color, for Gray and GrayAlpha images --&gt;
 169         &lt;!ATTLIST "bKGD_Grayscale" "gray" #CDATA #REQUIRED&gt;
 170           &lt;!-- A gray value to be used as a background --&gt;
 171           &lt;!-- Data type: Integer --&gt;
 172           &lt;!-- Min value: 0 (inclusive) --&gt;
 173           &lt;!-- Max value: 65535 (inclusive) --&gt;
 174 
 175       &lt;!ELEMENT "bKGD_RGB" EMPTY&gt;
 176         &lt;!-- An RGB background color, for RGB and RGBAlpha images --&gt;
 177         &lt;!ATTLIST "bKGD_RGB" "red" #CDATA #REQUIRED&gt;
 178           &lt;!-- A red value to be used as a background --&gt;
 179           &lt;!-- Data type: Integer --&gt;
 180           &lt;!-- Min value: 0 (inclusive) --&gt;
 181           &lt;!-- Max value: 65535 (inclusive) --&gt;
 182         &lt;!ATTLIST "bKGD_RGB" "green" #CDATA #REQUIRED&gt;
 183           &lt;!-- A green value to be used as a background --&gt;
 184           &lt;!-- Data type: Integer --&gt;
 185           &lt;!-- Min value: 0 (inclusive) --&gt;
 186           &lt;!-- Max value: 65535 (inclusive) --&gt;
 187         &lt;!ATTLIST "bKGD_RGB" "blue" #CDATA #REQUIRED&gt;
 188           &lt;!-- A blue value to be used as a background --&gt;
 189           &lt;!-- Data type: Integer --&gt;
 190           &lt;!-- Min value: 0 (inclusive) --&gt;
 191           &lt;!-- Max value: 65535 (inclusive) --&gt;
 192 
 193       &lt;!ELEMENT "bKGD_Palette" EMPTY&gt;
 194         &lt;!-- A background palette index --&gt;
 195         &lt;!ATTLIST "bKGD_Palette" "index" #CDATA #REQUIRED&gt;
 196           &lt;!-- A palette index to be used as a background --&gt;
 197           &lt;!-- Data type: Integer --&gt;
 198           &lt;!-- Min value: 0 (inclusive) --&gt;
 199           &lt;!-- Max value: 255 (inclusive) --&gt;
 200 
 201     &lt;!ELEMENT "cHRM" EMPTY&gt;
 202       &lt;!-- The cHRM chunk, containing color calibration --&gt;
 203       &lt;!ATTLIST "cHRM" "whitePointX" #CDATA #REQUIRED&gt;
 204         &lt;!-- The CIE x coordinate of the white point, multiplied by 1e5 --&gt;
 205         &lt;!-- Data type: Integer --&gt;
 206         &lt;!-- Min value: 0 (inclusive) --&gt;
 207         &lt;!-- Max value: 65535 (inclusive) --&gt;
 208       &lt;!ATTLIST "cHRM" "whitePointY" #CDATA #REQUIRED&gt;
 209         &lt;!-- The CIE y coordinate of the white point, multiplied by 1e5 --&gt;
 210         &lt;!-- Data type: Integer --&gt;
 211         &lt;!-- Min value: 0 (inclusive) --&gt;
 212         &lt;!-- Max value: 65535 (inclusive) --&gt;
 213       &lt;!ATTLIST "cHRM" "redX" #CDATA #REQUIRED&gt;
 214         &lt;!-- The CIE x coordinate of the red primary, multiplied by 1e5 --&gt;
 215         &lt;!-- Data type: Integer --&gt;
 216         &lt;!-- Min value: 0 (inclusive) --&gt;
 217         &lt;!-- Max value: 65535 (inclusive) --&gt;
 218       &lt;!ATTLIST "cHRM" "redY" #CDATA #REQUIRED&gt;
 219         &lt;!-- The CIE y coordinate of the red primary, multiplied by 1e5 --&gt;
 220         &lt;!-- Data type: Integer --&gt;
 221         &lt;!-- Min value: 0 (inclusive) --&gt;
 222         &lt;!-- Max value: 65535 (inclusive) --&gt;
 223       &lt;!ATTLIST "cHRM" "greenX" #CDATA #REQUIRED&gt;
 224         &lt;!-- The CIE x coordinate of the green primary, multiplied by 1e5 --&gt;
 225         &lt;!-- Data type: Integer --&gt;
 226         &lt;!-- Min value: 0 (inclusive) --&gt;
 227         &lt;!-- Max value: 65535 (inclusive) --&gt;
 228       &lt;!ATTLIST "cHRM" "greenY" #CDATA #REQUIRED&gt;
 229         &lt;!-- The CIE y coordinate of the green primary, multiplied by 1e5 --&gt;
 230         &lt;!-- Data type: Integer --&gt;
 231         &lt;!-- Min value: 0 (inclusive) --&gt;
 232         &lt;!-- Max value: 65535 (inclusive) --&gt;
 233       &lt;!ATTLIST "cHRM" "blueX" #CDATA #REQUIRED&gt;
 234         &lt;!-- The CIE x coordinate of the blue primary, multiplied by 1e5 --&gt;
 235         &lt;!-- Data type: Integer --&gt;
 236         &lt;!-- Min value: 0 (inclusive) --&gt;
 237         &lt;!-- Max value: 65535 (inclusive) --&gt;
 238       &lt;!ATTLIST "cHRM" "blueY" #CDATA #REQUIRED&gt;
 239         &lt;!-- The CIE y coordinate of the blue primary, multiplied by 1e5 --&gt;
 240         &lt;!-- Data type: Integer --&gt;
 241         &lt;!-- Min value: 0 (inclusive) --&gt;
 242         &lt;!-- Max value: 65535 (inclusive) --&gt;
 243 
 244     &lt;!ELEMENT "gAMA" EMPTY&gt;
 245       &lt;!-- The gAMA chunk, containing the image gamma --&gt;
 246       &lt;!ATTLIST "gAMA" "value" #CDATA #REQUIRED&gt;
 247         &lt;!-- The image gamma, multiplied by 1e5 --&gt;
 248         &lt;!-- Data type: Integer --&gt;
 249         &lt;!-- Min value: 0 (inclusive) --&gt;
 250         &lt;!-- Max value: 2147483647 (inclusive) --&gt;
 251 
 252     &lt;!ELEMENT "hIST" (hISTEntry)*&gt;
 253       &lt;!-- The hIST chunk, containing histogram information  --&gt;
 254       &lt;!-- Min children: 1 --&gt;
 255       &lt;!-- Max children: 256 --&gt;
 256 
 257       &lt;!ELEMENT "hISTEntry" EMPTY&gt;
 258         &lt;!-- A histogram entry --&gt;
 259         &lt;!ATTLIST "hISTEntry" "index" #CDATA #REQUIRED&gt;
 260           &lt;!-- The palette index of this histogram entry --&gt;
 261           &lt;!-- Data type: Integer --&gt;
 262           &lt;!-- Min value: 0 (inclusive) --&gt;
 263           &lt;!-- Max value: 255 (inclusive) --&gt;
 264         &lt;!ATTLIST "hISTEntry" "value" #CDATA #REQUIRED&gt;
 265           &lt;!-- The frequency of this histogram entry --&gt;
 266           &lt;!-- Data type: Integer --&gt;
 267           &lt;!-- Min value: 0 (inclusive) --&gt;
 268           &lt;!-- Max value: 65535 (inclusive) --&gt;
 269 
 270     &lt;!ELEMENT "iCCP" EMPTY&gt;
 271       &lt;!-- The iCCP chunk, containing an ICC color profile --&gt;
 272       &lt;!-- User object: array of byte --&gt;
 273       &lt;!-- Min length: 0 --&gt;
 274       &lt;!-- Max length: 2147483647 --&gt;
 275       &lt;!ATTLIST "iCCP" "profileName" #CDATA #REQUIRED&gt;
 276         &lt;!-- The name of this ICC profile --&gt;
 277         &lt;!-- Data type: String --&gt;
 278       &lt;!ATTLIST "iCCP" "compressionMethod" ("deflate") #REQUIRED&gt;
 279         &lt;!-- The compression method used to store this ICC profile --&gt;
 280 
 281     &lt;!ELEMENT "iTXt" (iTXtEntry)*&gt;
 282       &lt;!-- The iTXt chunk, containing internationalized text --&gt;
 283       &lt;!-- Min children: 1 --&gt;
 284       &lt;!-- Max children: 2147483647 --&gt;
 285 
 286       &lt;!ELEMENT "iTXtEntry" EMPTY&gt;
 287         &lt;!-- A localized text entry --&gt;
 288         &lt;!ATTLIST "iTXtEntry" "keyword" #CDATA #REQUIRED&gt;
 289           &lt;!-- The keyword --&gt;
 290           &lt;!-- Data type: String --&gt;
 291         &lt;!ATTLIST "iTXtEntry" "compressionFlag" ("TRUE" | "FALSE")
 292            #REQUIRED&gt;
 293         &lt;!ATTLIST "iTXtEntry" "compressionMethod" #CDATA #REQUIRED&gt;
 294           &lt;!-- The compression method used to store this iTXt entry --&gt;
 295           &lt;!-- Data type: String --&gt;
 296         &lt;!ATTLIST "iTXtEntry" "languageTag" #CDATA #REQUIRED&gt;
 297           &lt;!-- The ISO tag describing the language this iTXt entry --&gt;
 298           &lt;!-- Data type: String --&gt;
 299         &lt;!ATTLIST "iTXtEntry" "translatedKeyword" #CDATA #REQUIRED&gt;
 300           &lt;!-- The translated keyword for iTXt entry --&gt;
 301           &lt;!-- Data type: String --&gt;
 302         &lt;!ATTLIST "iTXtEntry" "text" #CDATA #REQUIRED&gt;
 303           &lt;!-- The localized text --&gt;
 304           &lt;!-- Data type: String --&gt;
 305 
 306     &lt;!ELEMENT "pHYS" EMPTY&gt;
 307       &lt;!-- The pHYS chunk, containing the pixel size and aspect ratio --&gt;
 308       &lt;!ATTLIST "pHYS" "pixelsPerUnitXAxis" #CDATA #REQUIRED&gt;
 309         &lt;!-- The number of horizontal pixels per unit, multiplied by 1e5 --&gt;
 310         &lt;!-- Data type: Integer --&gt;
 311         &lt;!-- Min value: 0 (inclusive) --&gt;
 312         &lt;!-- Max value: 2147483647 (inclusive) --&gt;
 313       &lt;!ATTLIST "pHYS" "pixelsPerUnitYAxis" #CDATA #REQUIRED&gt;
 314         &lt;!-- The number of vertical pixels per unit, multiplied by 1e5 --&gt;
 315         &lt;!-- Data type: Integer --&gt;
 316         &lt;!-- Min value: 0 (inclusive) --&gt;
 317         &lt;!-- Max value: 2147483647 (inclusive) --&gt;
 318       &lt;!ATTLIST "pHYS" "unitSpecifier" ("unknown" | "meter") #REQUIRED&gt;
 319         &lt;!-- The unit specifier for this chunk (i.e., meters) --&gt;
 320 
 321     &lt;!ELEMENT "sBIT" (sBIT_Grayscale | sBIT_GrayAlpha | sBIT_RGB | 
 322       sBIT_RGBAlpha | sBIT_Palette)&gt;
 323       &lt;!-- The sBIT chunk, containing significant bit information --&gt;
 324 
 325       &lt;!ELEMENT "sBIT_Grayscale" EMPTY&gt;
 326         &lt;!-- Significant bit information for gray samples --&gt;
 327         &lt;!ATTLIST "sBIT_Grayscale" "gray" #CDATA #REQUIRED&gt;
 328           &lt;!-- The number of significant bits of the gray samples --&gt;
 329           &lt;!-- Data type: Integer --&gt;
 330           &lt;!-- Min value: 0 (inclusive) --&gt;
 331           &lt;!-- Max value: 255 (inclusive) --&gt;
 332 
 333       &lt;!ELEMENT "sBIT_GrayAlpha" EMPTY&gt;
 334         &lt;!-- Significant bit information for gray and alpha samples --&gt;
 335         &lt;!ATTLIST "sBIT_GrayAlpha" "gray" #CDATA #REQUIRED&gt;
 336           &lt;!-- The number of significant bits of the gray samples --&gt;
 337           &lt;!-- Data type: Integer --&gt;
 338           &lt;!-- Min value: 0 (inclusive) --&gt;
 339           &lt;!-- Max value: 255 (inclusive) --&gt;
 340         &lt;!ATTLIST "sBIT_GrayAlpha" "alpha" #CDATA #REQUIRED&gt;
 341           &lt;!-- The number of significant bits of the alpha samples --&gt;
 342           &lt;!-- Data type: Integer --&gt;
 343           &lt;!-- Min value: 0 (inclusive) --&gt;
 344           &lt;!-- Max value: 255 (inclusive) --&gt;
 345 
 346       &lt;!ELEMENT "sBIT_RGB" EMPTY&gt;
 347         &lt;!-- Significant bit information for RGB samples --&gt;
 348         &lt;!ATTLIST "sBIT_RGB" "red" #CDATA #REQUIRED&gt;
 349           &lt;!-- The number of significant bits of the red samples --&gt;
 350           &lt;!-- Data type: Integer --&gt;
 351           &lt;!-- Min value: 0 (inclusive) --&gt;
 352           &lt;!-- Max value: 255 (inclusive) --&gt;
 353         &lt;!ATTLIST "sBIT_RGB" "green" #CDATA #REQUIRED&gt;
 354           &lt;!-- The number of significant bits of the green samples --&gt;
 355           &lt;!-- Data type: Integer --&gt;
 356           &lt;!-- Min value: 0 (inclusive) --&gt;
 357           &lt;!-- Max value: 255 (inclusive) --&gt;
 358         &lt;!ATTLIST "sBIT_RGB" "blue" #CDATA #REQUIRED&gt;
 359           &lt;!-- The number of significant bits of the blue samples --&gt;
 360           &lt;!-- Data type: Integer --&gt;
 361           &lt;!-- Min value: 0 (inclusive) --&gt;
 362           &lt;!-- Max value: 255 (inclusive) --&gt;
 363 
 364       &lt;!ELEMENT "sBIT_RGBAlpha" EMPTY&gt;
 365         &lt;!-- Significant bit information for RGBA samples --&gt;
 366         &lt;!ATTLIST "sBIT_RGBAlpha" "red" #CDATA #REQUIRED&gt;
 367           &lt;!-- The number of significant bits of the red samples --&gt;
 368           &lt;!-- Data type: Integer --&gt;
 369           &lt;!-- Min value: 0 (inclusive) --&gt;
 370           &lt;!-- Max value: 255 (inclusive) --&gt;
 371         &lt;!ATTLIST "sBIT_RGBAlpha" "green" #CDATA #REQUIRED&gt;
 372           &lt;!-- The number of significant bits of the green samples --&gt;
 373           &lt;!-- Data type: Integer --&gt;
 374           &lt;!-- Min value: 0 (inclusive) --&gt;
 375           &lt;!-- Max value: 255 (inclusive) --&gt;
 376         &lt;!ATTLIST "sBIT_RGBAlpha" "blue" #CDATA #REQUIRED&gt;
 377           &lt;!-- The number of significant bits of the blue samples --&gt;
 378           &lt;!-- Data type: Integer --&gt;
 379           &lt;!-- Min value: 0 (inclusive) --&gt;
 380           &lt;!-- Max value: 255 (inclusive) --&gt;
 381         &lt;!ATTLIST "sBIT_RGBAlpha" "alpha" #CDATA #REQUIRED&gt;
 382           &lt;!-- The number of significant bits of the alpha samples --&gt;
 383           &lt;!-- Data type: Integer --&gt;
 384           &lt;!-- Min value: 0 (inclusive) --&gt;
 385           &lt;!-- Max value: 255 (inclusive) --&gt;
 386 
 387       &lt;!ELEMENT "sBIT_Palette" EMPTY&gt;
 388         &lt;!-- Significant bit information for RGB palette entries --&gt;
 389         &lt;!ATTLIST "sBIT_Palette" "red" #CDATA #REQUIRED&gt;
 390           &lt;!-- The number of significant bits of the red palette entries --&gt;
 391           &lt;!-- Data type: Integer --&gt;
 392           &lt;!-- Min value: 0 (inclusive) --&gt;
 393           &lt;!-- Max value: 255 (inclusive) --&gt;
 394         &lt;!ATTLIST "sBIT_Palette" "green" #CDATA #REQUIRED&gt;
 395           &lt;!-- The number of significant bits of the green palette entries --&gt;
 396           &lt;!-- Data type: Integer --&gt;
 397           &lt;!-- Min value: 0 (inclusive) --&gt;
 398           &lt;!-- Max value: 255 (inclusive) --&gt;
 399         &lt;!ATTLIST "sBIT_Palette" "blue" #CDATA #REQUIRED&gt;
 400           &lt;!-- The number of significant bits of the blue palette entries --&gt;
 401           &lt;!-- Data type: Integer --&gt;
 402           &lt;!-- Min value: 0 (inclusive) --&gt;
 403           &lt;!-- Max value: 255 (inclusive) --&gt;
 404 
 405     &lt;!ELEMENT "sPLT" (sPLTEntry)*&gt;
 406       &lt;!-- The sPLT chunk, containing a suggested palette --&gt;
 407       &lt;!-- Min children: 1 --&gt;
 408       &lt;!-- Max children: 256 --&gt;
 409 
 410       &lt;!ELEMENT "sPLTEntry" EMPTY&gt;
 411         &lt;!-- A suggested palette entry --&gt;
 412         &lt;!ATTLIST "sPLTEntry" "index" #CDATA #REQUIRED&gt;
 413           &lt;!-- The index of a suggested palette entry --&gt;
 414           &lt;!-- Data type: Integer --&gt;
 415           &lt;!-- Min value: 0 (inclusive) --&gt;
 416           &lt;!-- Max value: 255 (inclusive) --&gt;
 417         &lt;!ATTLIST "sPLTEntry" "red" #CDATA #REQUIRED&gt;
 418           &lt;!-- The red value of a suggested palette entry --&gt;
 419           &lt;!-- Data type: Integer --&gt;
 420           &lt;!-- Min value: 0 (inclusive) --&gt;
 421           &lt;!-- Max value: 255 (inclusive) --&gt;
 422         &lt;!ATTLIST "sPLTEntry" "green" #CDATA #REQUIRED&gt;
 423           &lt;!-- The green value of a suggested palette entry --&gt;
 424           &lt;!-- Data type: Integer --&gt;
 425           &lt;!-- Min value: 0 (inclusive) --&gt;
 426           &lt;!-- Max value: 255 (inclusive) --&gt;
 427         &lt;!ATTLIST "sPLTEntry" "blue" #CDATA #REQUIRED&gt;
 428           &lt;!-- The blue value of a suggested palette entry --&gt;
 429           &lt;!-- Data type: Integer --&gt;
 430           &lt;!-- Min value: 0 (inclusive) --&gt;
 431           &lt;!-- Max value: 255 (inclusive) --&gt;
 432         &lt;!ATTLIST "sPLTEntry" "alpha" #CDATA #REQUIRED&gt;
 433           &lt;!-- The blue value of a suggested palette entry --&gt;
 434           &lt;!-- Data type: Integer --&gt;
 435           &lt;!-- Min value: 0 (inclusive) --&gt;
 436           &lt;!-- Max value: 255 (inclusive) --&gt;
 437 
 438     &lt;!ELEMENT "sRGB" EMPTY&gt;
 439       &lt;!-- The sRGB chunk, containing rendering intent information --&gt;
 440       &lt;!ATTLIST "sRGB" "renderingIntent" ("Perceptual" | 
 441         "Relative colorimetric" | "Saturation" | 
 442         "Absolute colorimetric") #REQUIRED&gt;
 443         &lt;!-- The rendering intent --&gt;
 444 
 445     &lt;!ELEMENT "tEXt" (tEXtEntry)*&gt;
 446       &lt;!-- The tEXt chunk, containing text --&gt;
 447       &lt;!-- Min children: 1 --&gt;
 448       &lt;!-- Max children: 2147483647 --&gt;
 449 
 450       &lt;!ELEMENT "tEXtEntry" EMPTY&gt;
 451         &lt;!-- A text entry --&gt;
 452         &lt;!ATTLIST "tEXtEntry" "keyword" #CDATA #REQUIRED&gt;
 453           &lt;!-- The keyword --&gt;
 454           &lt;!-- Data type: String --&gt;
 455         &lt;!ATTLIST "tEXtEntry" "value" #CDATA #REQUIRED&gt;
 456           &lt;!-- The text --&gt;
 457           &lt;!-- Data type: String --&gt;
 458 
 459     &lt;!ELEMENT "tIME" EMPTY&gt;
 460       &lt;!-- The tIME chunk, containing the image modification time --&gt;
 461       &lt;!ATTLIST "tIME" "year" #CDATA #REQUIRED&gt;
 462         &lt;!-- The year when the image was last modified --&gt;
 463         &lt;!-- Data type: Integer --&gt;
 464         &lt;!-- Min value: 0 (inclusive) --&gt;
 465         &lt;!-- Max value: 65535 (inclusive) --&gt;
 466       &lt;!ATTLIST "tIME" "month" #CDATA #REQUIRED&gt;
 467         &lt;!-- The month when the image was last modified, 1 = January --&gt;
 468         &lt;!-- Data type: Integer --&gt;
 469         &lt;!-- Min value: 1 (inclusive) --&gt;
 470         &lt;!-- Max value: 12 (inclusive) --&gt;
 471       &lt;!ATTLIST "tIME" "day" #CDATA #REQUIRED&gt;
 472         &lt;!-- The day of the month when the image was last modified --&gt;
 473         &lt;!-- Data type: Integer --&gt;
 474         &lt;!-- Min value: 1 (inclusive) --&gt;
 475         &lt;!-- Max value: 31 (inclusive) --&gt;
 476       &lt;!ATTLIST "tIME" "hour" #CDATA #REQUIRED&gt;
 477         &lt;!-- The hour when the image was last modified --&gt;
 478         &lt;!-- Data type: Integer --&gt;
 479         &lt;!-- Min value: 0 (inclusive) --&gt;
 480         &lt;!-- Max value: 23 (inclusive) --&gt;
 481       &lt;!ATTLIST "tIME" "minute" #CDATA #REQUIRED&gt;
 482         &lt;!-- The minute when the image was last modified --&gt;
 483         &lt;!-- Data type: Integer --&gt;
 484         &lt;!-- Min value: 0 (inclusive) --&gt;
 485         &lt;!-- Max value: 59 (inclusive) --&gt;
 486       &lt;!ATTLIST "tIME" "second" #CDATA #REQUIRED&gt;
 487         &lt;!-- The second when the image was last modified, 60 = leap second --&gt;
 488         &lt;!-- Data type: Integer --&gt;
 489         &lt;!-- Min value: 0 (inclusive) --&gt;
 490         &lt;!-- Max value: 60 (inclusive) --&gt;
 491 
 492     &lt;!ELEMENT "tRNS" (tRNS_Grayscale | tRNS_RGB | tRNS_Palette)&gt;
 493       &lt;!-- The tRNS chunk, containing transparency information --&gt;
 494 
 495       &lt;!ELEMENT "tRNS_Grayscale" EMPTY&gt;
 496         &lt;!-- A grayscale value that should be considered transparent --&gt;
 497         &lt;!ATTLIST "tRNS_Grayscale" "gray" #CDATA #REQUIRED&gt;
 498           &lt;!-- The gray value to be considered transparent --&gt;
 499           &lt;!-- Data type: Integer --&gt;
 500           &lt;!-- Min value: 0 (inclusive) --&gt;
 501           &lt;!-- Max value: 65535 (inclusive) --&gt;
 502 
 503       &lt;!ELEMENT "tRNS_RGB" EMPTY&gt;
 504         &lt;!-- An RGB value that should be considered transparent --&gt;
 505         &lt;!ATTLIST "tRNS_RGB" "red" #CDATA #REQUIRED&gt;
 506           &lt;!-- The red value to be considered transparent --&gt;
 507           &lt;!-- Data type: Integer --&gt;
 508           &lt;!-- Min value: 0 (inclusive) --&gt;
 509           &lt;!-- Max value: 65535 (inclusive) --&gt;
 510         &lt;!ATTLIST "tRNS_RGB" "green" #CDATA #REQUIRED&gt;
 511           &lt;!-- The green value to be considered transparent --&gt;
 512           &lt;!-- Data type: Integer --&gt;
 513           &lt;!-- Min value: 0 (inclusive) --&gt;
 514           &lt;!-- Max value: 65535 (inclusive) --&gt;
 515         &lt;!ATTLIST "tRNS_RGB" "blue" #CDATA #REQUIRED&gt;
 516           &lt;!-- The blure value to be considered transparent --&gt;
 517           &lt;!-- Data type: Integer --&gt;
 518           &lt;!-- Min value: 0 (inclusive) --&gt;
 519           &lt;!-- Max value: 65535 (inclusive) --&gt;
 520 
 521       &lt;!ELEMENT "tRNS_Palette" EMPTY&gt;
 522         &lt;!-- A palette index that should be considered transparent --&gt;
 523         &lt;!ATTLIST "tRNS_Palette" "index" #CDATA #REQUIRED&gt;
 524           &lt;!-- A palette index to be considered transparent --&gt;
 525           &lt;!-- Data type: Integer --&gt;
 526           &lt;!-- Min value: 0 (inclusive) --&gt;
 527           &lt;!-- Max value: 255 (inclusive) --&gt;
 528         &lt;!ATTLIST "tRNS_Palette" "alpha" #CDATA #REQUIRED&gt;
 529           &lt;!-- The transparency associated with the palette entry --&gt;
 530           &lt;!-- Data type: Integer --&gt;
 531           &lt;!-- Min value: 0 (inclusive) --&gt;
 532           &lt;!-- Max value: 255 (inclusive) --&gt;
 533 
 534     &lt;!ELEMENT "zTXt" (zTXtEntry)*&gt;
 535       &lt;!-- The zTXt chunk, containing compressed text --&gt;
 536       &lt;!-- Min children: 1 --&gt;
 537       &lt;!-- Max children: 2147483647 --&gt;
 538 
 539       &lt;!ELEMENT "zTXtEntry" EMPTY&gt;
 540         &lt;!-- A compressed text entry --&gt;
 541         &lt;!-- User object: array of byte --&gt;
 542         &lt;!-- Min length: 0 --&gt;
 543         &lt;!-- Max length: 2147483647 --&gt;
 544         &lt;!ATTLIST "zTXtEntry" "keyword" #CDATA #REQUIRED&gt;
 545           &lt;!-- The keyword --&gt;
 546           &lt;!-- Data type: String --&gt;
 547         &lt;!ATTLIST "zTXtEntry" "compressionMethod" ("deflate")
 548            #REQUIRED&gt;
 549           &lt;!-- The compressed text --&gt;
 550 
 551     &lt;!ELEMENT "UnknownChunks" (UnknownChunk)*&gt;
 552       &lt;!-- A set of unknown chunks --&gt;
 553       &lt;!-- Min children: 1 --&gt;
 554       &lt;!-- Max children: 2147483647 --&gt;
 555 
 556       &lt;!ELEMENT "UnknownChunk" EMPTY&gt;
 557         &lt;!-- Unknown chunk data stored as a byte array --&gt;
 558         &lt;!-- User object: array of byte --&gt;
 559         &lt;!-- Min length: 0 --&gt;
 560         &lt;!-- Max length: 2147483647 --&gt;
 561         &lt;!ATTLIST "UnknownChunk" "type" #CDATA #REQUIRED&gt;
 562           &lt;!-- The 4-character type of the unknown chunk --&gt;
 563           &lt;!-- Data type: String --&gt;
 564 ]&gt;
 565 </pre>
 566 
 567 </body>
 568 </html>
--- EOF ---