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 <!DOCTYPE "javax_imageio_png_1.0" [ |
103 <!DOCTYPE "javax_imageio_png_1.0" [ |
106 |
104 |
107 <!ELEMENT "javax_imageio_png_1.0" (IHDR?, PLTE?, bKGD?, cHRM?, |
105 <!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?)> |
107 tIME?, tRNS?, zTXt?, UnknownChunks?)> |
110 |
108 |
111 <!ELEMENT "IHDR" EMPTY> |
109 <!ELEMENT "IHDR" EMPTY> |
112 <!-- The IHDR chunk, containing the header --> |
110 <!-- The IHDR chunk, containing the header --> |
113 <!ATTLIST "IHDR" "width" #CDATA #REQUIRED> |
111 <!ATTLIST "IHDR" "width" #CDATA #REQUIRED> |
121 <!-- Min value: 1 (inclusive) --> |
119 <!-- Min value: 1 (inclusive) --> |
122 <!-- Max value: 2147483647 (inclusive) --> |
120 <!-- Max value: 2147483647 (inclusive) --> |
123 <!ATTLIST "IHDR" "bitDepth" ("1" | "2" | "4" | "8" | "16") |
121 <!ATTLIST "IHDR" "bitDepth" ("1" | "2" | "4" | "8" | "16") |
124 #REQUIRED> |
122 #REQUIRED> |
125 <!-- The bit depth of the image samples --> |
123 <!-- The bit depth of the image samples --> |
126 <!ATTLIST "IHDR" "colorType" ("Grayscale" | "RGB" | "Palette" | |
124 <!ATTLIST "IHDR" "colorType" ("Grayscale" | "RGB" | "Palette" | |
127 "GrayAlpha" | "RGBAlpha") #REQUIRED> |
125 "GrayAlpha" | "RGBAlpha") #REQUIRED> |
128 <!-- The color type of the image --> |
126 <!-- The color type of the image --> |
129 <!ATTLIST "IHDR" "compressionMethod" ("deflate") #REQUIRED> |
127 <!ATTLIST "IHDR" "compressionMethod" ("deflate") #REQUIRED> |
130 <!-- The compression used for image data, always "deflate" --> |
128 <!-- The compression used for image data, always "deflate" --> |
131 <!ATTLIST "IHDR" "filterMethod" ("adaptive") #REQUIRED> |
129 <!ATTLIST "IHDR" "filterMethod" ("adaptive") #REQUIRED> |
316 <!-- Min value: 0 (inclusive) --> |
314 <!-- Min value: 0 (inclusive) --> |
317 <!-- Max value: 2147483647 (inclusive) --> |
315 <!-- Max value: 2147483647 (inclusive) --> |
318 <!ATTLIST "pHYS" "unitSpecifier" ("unknown" | "meter") #REQUIRED> |
316 <!ATTLIST "pHYS" "unitSpecifier" ("unknown" | "meter") #REQUIRED> |
319 <!-- The unit specifier for this chunk (i.e., meters) --> |
317 <!-- The unit specifier for this chunk (i.e., meters) --> |
320 |
318 |
321 <!ELEMENT "sBIT" (sBIT_Grayscale | sBIT_GrayAlpha | sBIT_RGB | |
319 <!ELEMENT "sBIT" (sBIT_Grayscale | sBIT_GrayAlpha | sBIT_RGB | |
322 sBIT_RGBAlpha | sBIT_Palette)> |
320 sBIT_RGBAlpha | sBIT_Palette)> |
323 <!-- The sBIT chunk, containing significant bit information --> |
321 <!-- The sBIT chunk, containing significant bit information --> |
324 |
322 |
325 <!ELEMENT "sBIT_Grayscale" EMPTY> |
323 <!ELEMENT "sBIT_Grayscale" EMPTY> |
326 <!-- Significant bit information for gray samples --> |
324 <!-- Significant bit information for gray samples --> |
435 <!-- Min value: 0 (inclusive) --> |
433 <!-- Min value: 0 (inclusive) --> |
436 <!-- Max value: 255 (inclusive) --> |
434 <!-- Max value: 255 (inclusive) --> |
437 |
435 |
438 <!ELEMENT "sRGB" EMPTY> |
436 <!ELEMENT "sRGB" EMPTY> |
439 <!-- The sRGB chunk, containing rendering intent information --> |
437 <!-- The sRGB chunk, containing rendering intent information --> |
440 <!ATTLIST "sRGB" "renderingIntent" ("Perceptual" | |
438 <!ATTLIST "sRGB" "renderingIntent" ("Perceptual" | |
441 "Relative colorimetric" | "Saturation" | |
439 "Relative colorimetric" | "Saturation" | |
442 "Absolute colorimetric") #REQUIRED> |
440 "Absolute colorimetric") #REQUIRED> |
443 <!-- The rendering intent --> |
441 <!-- The rendering intent --> |
444 |
442 |
445 <!ELEMENT "tEXt" (tEXtEntry)*> |
443 <!ELEMENT "tEXt" (tEXtEntry)*> |
446 <!-- The tEXt chunk, containing text --> |
444 <!-- The tEXt chunk, containing text --> |