src/java.desktop/share/classes/javax/imageio/metadata/doc-files/png_metadata.html
changeset 48264 efda6932a433
parent 47216 71c04702a3d5
child 50358 1ba28f0dbc33
equal deleted inserted replaced
47982:44371ff1ee9a 48264:efda6932a433
     1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
     1 <!doctype html>
     2 <html>
     2 <html lang="en">
     3 <head>
     3 <head>
       
     4   <meta charset="utf-8"/>
       
     5   <title>PNG Metadata Format Specification</title>
       
     6 </head>
     4 <!--
     7 <!--
     5 Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
     8 Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
     6 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     9 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     7 
    10 
     8 This code is free software; you can redistribute it and/or modify it
    11 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
    12 under the terms of the GNU General Public License version 2 only, as
    10 published by the Free Software Foundation.  Oracle designates this
    13 published by the Free Software Foundation.  Oracle designates this
    24 Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    27 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
    28 or visit www.oracle.com if you need additional information or have any
    26 questions.
    29 questions.
    27 -->
    30 -->
    28 
    31 
    29 <title>PNG Metadata Format Specification</title>
    32 <body>
    30 </head>
    33 
    31 
    34 <h1>PNG Metadata Format Specification</h1>
    32 <body bgcolor="white">
       
    33 
       
    34 <center><h1>
       
    35 PNG Metadata Format Specification
       
    36 </h1></center>
       
    37 
    35 
    38 <p>
    36 <p>
    39 
    37 
    40 The PNG native format encodes the complete contents of a PNG file
    38 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
    39 chunk by chunk, except for the IDAT chunks that contain the actual
    57 uniform grayscale ramp. If so, the image will normally be encoded
    55 uniform grayscale ramp. If so, the image will normally be encoded
    58 using as grayscale instead of palette color.  However, if the color
    56 using as grayscale instead of palette color.  However, if the color
    59 type set in the metadata is "Palette", palette color will be used.
    57 type set in the metadata is "Palette", palette color will be used.
    60 
    58 
    61 <p>
    59 <p>
    62  
    60 
    63 If no metadata is supplied when encoding an image, the header is
    61 If no metadata is supplied when encoding an image, the header is
    64 initialized from the image being encoded, and no optional chunks are
    62 initialized from the image being encoded, and no optional chunks are
    65 included.
    63 included.
    66 
    64 
    67 <p>
    65 <p>
    83 </ul>
    81 </ul>
    84 
    82 
    85 The child nodes of the <code>bKGD</code>, <code>sBIT</code>, and
    83 The child nodes of the <code>bKGD</code>, <code>sBIT</code>, and
    86 <code>tRNS</code> chunks must match the image's color type.
    84 <code>tRNS</code> chunks must match the image's color type.
    87 
    85 
    88 <p> 
    86 <p>
    89 
    87 
    90 Certain chunks may meaningfully appear multiple times in a PNG file,
    88 Certain chunks may meaningfully appear multiple times in a PNG file,
    91 in particular the text-related chunks.  In order to simplify the
    89 in particular the text-related chunks.  In order to simplify the
    92 metadata format, multiple instances of these chunks are consolidated
    90 metadata format, multiple instances of these chunks are consolidated
    93 under a single parent node (<i>e.g.</i>, the <code>tEXt</code> node),
    91 under a single parent node (<i>e.g.</i>, the <code>tEXt</code> node),
   102 written, or to determine the order of the chunks in a file being read.
   100 written, or to determine the order of the chunks in a file being read.
   103 
   101 
   104 <pre>
   102 <pre>
   105 &lt;!DOCTYPE "javax_imageio_png_1.0" [
   103 &lt;!DOCTYPE "javax_imageio_png_1.0" [
   106 
   104 
   107   &lt;!ELEMENT "javax_imageio_png_1.0" (IHDR?, PLTE?, bKGD?, cHRM?, 
   105   &lt;!ELEMENT "javax_imageio_png_1.0" (IHDR?, PLTE?, bKGD?, cHRM?,
   108     gAMA?, hIST?, iCCP?, iTXt?, pHYS?, sBIT?, sPLT?, sRGB?, tEXt?, 
   106     gAMA?, hIST?, iCCP?, iTXt?, pHYS?, sBIT?, sPLT?, sRGB?, tEXt?,
   109     tIME?, tRNS?, zTXt?, UnknownChunks?)&gt;
   107     tIME?, tRNS?, zTXt?, UnknownChunks?)&gt;
   110 
   108 
   111     &lt;!ELEMENT "IHDR" EMPTY&gt;
   109     &lt;!ELEMENT "IHDR" EMPTY&gt;
   112       &lt;!-- The IHDR chunk, containing the header --&gt;
   110       &lt;!-- The IHDR chunk, containing the header --&gt;
   113       &lt;!ATTLIST "IHDR" "width" #CDATA #REQUIRED&gt;
   111       &lt;!ATTLIST "IHDR" "width" #CDATA #REQUIRED&gt;
   121         &lt;!-- Min value: 1 (inclusive) --&gt;
   119         &lt;!-- Min value: 1 (inclusive) --&gt;
   122         &lt;!-- Max value: 2147483647 (inclusive) --&gt;
   120         &lt;!-- Max value: 2147483647 (inclusive) --&gt;
   123       &lt;!ATTLIST "IHDR" "bitDepth" ("1" | "2" | "4" | "8" | "16")
   121       &lt;!ATTLIST "IHDR" "bitDepth" ("1" | "2" | "4" | "8" | "16")
   124          #REQUIRED&gt;
   122          #REQUIRED&gt;
   125         &lt;!-- The bit depth of the image samples --&gt;
   123         &lt;!-- The bit depth of the image samples --&gt;
   126       &lt;!ATTLIST "IHDR" "colorType" ("Grayscale" | "RGB" | "Palette" | 
   124       &lt;!ATTLIST "IHDR" "colorType" ("Grayscale" | "RGB" | "Palette" |
   127         "GrayAlpha" | "RGBAlpha") #REQUIRED&gt;
   125         "GrayAlpha" | "RGBAlpha") #REQUIRED&gt;
   128         &lt;!-- The color type of the image --&gt;
   126         &lt;!-- The color type of the image --&gt;
   129       &lt;!ATTLIST "IHDR" "compressionMethod" ("deflate") #REQUIRED&gt;
   127       &lt;!ATTLIST "IHDR" "compressionMethod" ("deflate") #REQUIRED&gt;
   130         &lt;!-- The compression used for image data, always "deflate" --&gt;
   128         &lt;!-- The compression used for image data, always "deflate" --&gt;
   131       &lt;!ATTLIST "IHDR" "filterMethod" ("adaptive") #REQUIRED&gt;
   129       &lt;!ATTLIST "IHDR" "filterMethod" ("adaptive") #REQUIRED&gt;
   316         &lt;!-- Min value: 0 (inclusive) --&gt;
   314         &lt;!-- Min value: 0 (inclusive) --&gt;
   317         &lt;!-- Max value: 2147483647 (inclusive) --&gt;
   315         &lt;!-- Max value: 2147483647 (inclusive) --&gt;
   318       &lt;!ATTLIST "pHYS" "unitSpecifier" ("unknown" | "meter") #REQUIRED&gt;
   316       &lt;!ATTLIST "pHYS" "unitSpecifier" ("unknown" | "meter") #REQUIRED&gt;
   319         &lt;!-- The unit specifier for this chunk (i.e., meters) --&gt;
   317         &lt;!-- The unit specifier for this chunk (i.e., meters) --&gt;
   320 
   318 
   321     &lt;!ELEMENT "sBIT" (sBIT_Grayscale | sBIT_GrayAlpha | sBIT_RGB | 
   319     &lt;!ELEMENT "sBIT" (sBIT_Grayscale | sBIT_GrayAlpha | sBIT_RGB |
   322       sBIT_RGBAlpha | sBIT_Palette)&gt;
   320       sBIT_RGBAlpha | sBIT_Palette)&gt;
   323       &lt;!-- The sBIT chunk, containing significant bit information --&gt;
   321       &lt;!-- The sBIT chunk, containing significant bit information --&gt;
   324 
   322 
   325       &lt;!ELEMENT "sBIT_Grayscale" EMPTY&gt;
   323       &lt;!ELEMENT "sBIT_Grayscale" EMPTY&gt;
   326         &lt;!-- Significant bit information for gray samples --&gt;
   324         &lt;!-- Significant bit information for gray samples --&gt;
   435           &lt;!-- Min value: 0 (inclusive) --&gt;
   433           &lt;!-- Min value: 0 (inclusive) --&gt;
   436           &lt;!-- Max value: 255 (inclusive) --&gt;
   434           &lt;!-- Max value: 255 (inclusive) --&gt;
   437 
   435 
   438     &lt;!ELEMENT "sRGB" EMPTY&gt;
   436     &lt;!ELEMENT "sRGB" EMPTY&gt;
   439       &lt;!-- The sRGB chunk, containing rendering intent information --&gt;
   437       &lt;!-- The sRGB chunk, containing rendering intent information --&gt;
   440       &lt;!ATTLIST "sRGB" "renderingIntent" ("Perceptual" | 
   438       &lt;!ATTLIST "sRGB" "renderingIntent" ("Perceptual" |
   441         "Relative colorimetric" | "Saturation" | 
   439         "Relative colorimetric" | "Saturation" |
   442         "Absolute colorimetric") #REQUIRED&gt;
   440         "Absolute colorimetric") #REQUIRED&gt;
   443         &lt;!-- The rendering intent --&gt;
   441         &lt;!-- The rendering intent --&gt;
   444 
   442 
   445     &lt;!ELEMENT "tEXt" (tEXtEntry)*&gt;
   443     &lt;!ELEMENT "tEXt" (tEXtEntry)*&gt;
   446       &lt;!-- The tEXt chunk, containing text --&gt;
   444       &lt;!-- The tEXt chunk, containing text --&gt;