< prev index next >

src/java.desktop/share/classes/javax/imageio/metadata/doc-files/gif_metadata.html

Print this page


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



   4 <!--
   5 Copyright (c) 2000, 2015, 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>GIF Metadata Format Specification</title>
  30 </head>
  31 
  32 <body bgcolor="white">
  33 
  34 <center><h1>
  35 GIF Metadata Format Specification
  36 </h1></center>
  37 <a name="gif_stream_metadata_format"></a>
  38 <center><h2>
  39 GIF Stream Metadata Format Specification
  40 </h2></center>
  41 
  42 <p>
  43 
  44 The GIF stream metadata format encodes the information stored in the
  45 per-file header, namely the file version, logical screen descriptor,
  46 and the global color table.
  47 
  48 <p>
  49 
  50 The logical screen descriptor describes the overall width and height
  51 of an animated file, as well as information about the color resolution
  52 (number of bits per pixel) and pixel aspect ratio.
  53 
  54 <p>
  55 
  56 The global color table contains a color lookup table that is used for
  57 images that do not have their own local color table.
  58 
  59 <pre>
  60 &lt;!DOCTYPE "javax_imageio_gif_stream_1.0" [


 118           &lt;!-- Data type: Integer --&gt;
 119           &lt;!-- Min value: 0 (inclusive) --&gt;
 120           &lt;!-- Max value: 255 (inclusive) --&gt;
 121         &lt;!ATTLIST "ColorTableEntry" "red" #CDATA #REQUIRED&gt;
 122           &lt;!-- The red value for the color table entry --&gt;
 123           &lt;!-- Data type: Integer --&gt;
 124           &lt;!-- Min value: 0 (inclusive) --&gt;
 125           &lt;!-- Max value: 255 (inclusive) --&gt;
 126         &lt;!ATTLIST "ColorTableEntry" "green" #CDATA #REQUIRED&gt;
 127           &lt;!-- The green value for the color table entry --&gt;
 128           &lt;!-- Data type: Integer --&gt;
 129           &lt;!-- Min value: 0 (inclusive) --&gt;
 130           &lt;!-- Max value: 255 (inclusive) --&gt;
 131         &lt;!ATTLIST "ColorTableEntry" "blue" #CDATA #REQUIRED&gt;
 132           &lt;!-- The blue value for the color table entry --&gt;
 133           &lt;!-- Data type: Integer --&gt;
 134           &lt;!-- Min value: 0 (inclusive) --&gt;
 135           &lt;!-- Max value: 255 (inclusive) --&gt;
 136 ]&gt;
 137 </pre>
 138 <a name="gif_image_metadata_format"></a>
 139 <center><h2>
 140 GIF Image Metadata Format Specification
 141 </h2></center>
 142 <p>
 143 
 144 The GIF image metadata format encodes the image descriptor, local
 145 color table, and extension information assciated with a single image
 146 within a GIF file, typically a frame of an animation.
 147 
 148 <p>
 149 
 150 The image description contains the offset of the frame within the
 151 logical screen described in the stream metadata, as well as the width
 152 and height of the frame and whether it is used interlaced encoding.
 153 
 154 <p>
 155 
 156 The local color table, if present, supersedes the global color table
 157 for the frame at hand.
 158 
 159 <p>
 160 
 161 The graphic control extension contains information on how the frame is


 333           &lt;!-- Data type: String --&gt;
 334         &lt;!ATTLIST "ApplicationExtension" "authenticationCode" #CDATA
 335            #REQUIRED&gt;
 336           &lt;!-- The authentication code --&gt;
 337           &lt;!-- Data type: String --&gt;
 338 
 339     &lt;!ELEMENT "CommentExtensions" (CommentExtension)*&gt;
 340       &lt;!-- A set of comments --&gt;
 341       &lt;!-- Min children: 1 --&gt;
 342       &lt;!-- Max children: 2147483647 --&gt;
 343 
 344       &lt;!ELEMENT "CommentExtension" EMPTY&gt;
 345         &lt;!-- A comment --&gt;
 346         &lt;!ATTLIST "CommentExtension" "value" #CDATA #REQUIRED&gt;
 347           &lt;!-- The comment --&gt;
 348           &lt;!-- Data type: String --&gt;
 349 ]&gt;
 350 </pre>
 351 
 352 <p>
 353 <a name="mapping"></a>
 354 <center>
 355 <table border=1>
 356 <caption><b>Mapping of Standard to GIF Native Stream Metadata</b></caption>
 357 <tr>
 358 <th>Standard Metadata Component</th>
 359 <th>GIF Native Stream Metadata Component</th>
 360 </tr>
 361 <tr>
 362 <td>/Chroma/Palette/PaletteEntry@index</td>
 363 <td>/GlobalColorTable/ColorTableEntry@index</td>
 364 </tr>
 365 <tr>
 366 <td>/Chroma/Palette/PaletteEntry@red</td>
 367 <td>/GlobalColorTable/ColorTableEntry@red</td>
 368 </tr>
 369 <tr>
 370 <td>/Chroma/Palette/PaletteEntry@green</td>
 371 <td>/GlobalColorTable/ColorTableEntry@green</td>
 372 </tr>
 373 <tr>
 374 <td>/Chroma/Palette/PaletteEntry@blue</td>


 382 <td>/Data/BitsPerSample@value</td>
 383 <td>/LogicalScreenDescriptor@colorResolution</td>
 384 </tr>
 385 <tr>
 386 <td>/Dimension/PixelAspectRatio@value</td>
 387 <td>/LogicalScreenDescriptor@pixelAspectRatio</td>
 388 </tr>
 389 <tr>
 390 <td>/Dimension/HorizontalScreenSize@value</td>
 391 <td>/LogicalScreenDescriptor@logicalScreenWidth</td>
 392 </tr>
 393 <tr>
 394 <td>/Dimension/VerticalScreenSize@value</td>
 395 <td>/LogicalScreenDescriptor@logicalScreenHeight</td>
 396 </tr>
 397 <tr>
 398 <td>/Document/FormatVersion@value</td>
 399 <td>/Version@value</td>
 400 </tr>
 401 </table>
 402 </center>
 403 
 404 <center>
 405 <table border=1>
 406 <caption><b>Mapping of Standard to GIF Native Image Metadata</b></caption>
 407 <tr>
 408 <th>Standard Metadata Component</th>
 409 <th>GIF Native Image Metadata Component</th>
 410 </tr>
 411 <tr>
 412 <td>/Chroma/Palette/PaletteEntry@index</td>
 413 <td>/LocalColorTable/ColorTableEntry@index</td>
 414 </tr>
 415 <tr>
 416 <td>/Chroma/Palette/PaletteEntry@red</td>
 417 <td>/LocalColorTable/ColorTableEntry@red</td>
 418 </tr>
 419 <tr>
 420 <td>/Chroma/Palette/PaletteEntry@green</td>
 421 <td>/LocalColorTable/ColorTableEntry@green</td>
 422 </tr>
 423 <tr>
 424 <td>/Chroma/Palette/PaletteEntry@blue</td>


 426 </tr>
 427 <tr>
 428 <td>/Dimension/HorizontalPixelOffset@value</td>
 429 <td>/ImageDescriptor@imageLeftPosition</td>
 430 </tr>
 431 <tr>
 432 <td>/Dimension/VerticalPixelOffset@value</td>
 433 <td>/ImageDescriptor@imageTopPosition</td>
 434 </tr>
 435 <tr>
 436 <td>/Text/TextEntry@value</td>
 437 <td>/CommentExtensions/CommentExtension@value</td>
 438 </tr>
 439 <tr>
 440 <td>/Transparency/TransparentIndex@value</td>
 441 <td>/GraphicControlExtension@transparentColorIndex
 442 (/GraphicControlExtension@transparentColorFlag is also set to
 443 "TRUE")</td>
 444 </tr>
 445 </table>
 446 </center>
 447 
 448 </body>
 449 </html>
   1 <!doctype html>
   2 <html lang="en">
   3 <head>
   4   <meta charset="utf-8"/>
   5   <title>GIF Metadata Format Specification</title>
   6 </head>
   7 <!--
   8 Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
   9 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  10 
  11 This code is free software; you can redistribute it and/or modify it
  12 under the terms of the GNU General Public License version 2 only, as
  13 published by the Free Software Foundation.  Oracle designates this
  14 particular file as subject to the "Classpath" exception as provided
  15 by Oracle in the LICENSE file that accompanied this code.
  16 
  17 This code is distributed in the hope that it will be useful, but WITHOUT
  18 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  19 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  20 version 2 for more details (a copy is included in the LICENSE file that
  21 accompanied this code).
  22 
  23 You should have received a copy of the GNU General Public License version
  24 2 along with this work; if not, write to the Free Software Foundation,
  25 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  26 
  27 Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  28 or visit www.oracle.com if you need additional information or have any
  29 questions.
  30 -->
  31 
  32 <body>



  33 
  34 <h1>GIF Metadata Format Specification</h1>
  35 <a id="gif_stream_metadata_format"></a>
  36 <h2>GIF Stream Metadata Format Specification</h2>




  37 
  38 <p>
  39 
  40 The GIF stream metadata format encodes the information stored in the
  41 per-file header, namely the file version, logical screen descriptor,
  42 and the global color table.
  43 
  44 <p>
  45 
  46 The logical screen descriptor describes the overall width and height
  47 of an animated file, as well as information about the color resolution
  48 (number of bits per pixel) and pixel aspect ratio.
  49 
  50 <p>
  51 
  52 The global color table contains a color lookup table that is used for
  53 images that do not have their own local color table.
  54 
  55 <pre>
  56 &lt;!DOCTYPE "javax_imageio_gif_stream_1.0" [


 114           &lt;!-- Data type: Integer --&gt;
 115           &lt;!-- Min value: 0 (inclusive) --&gt;
 116           &lt;!-- Max value: 255 (inclusive) --&gt;
 117         &lt;!ATTLIST "ColorTableEntry" "red" #CDATA #REQUIRED&gt;
 118           &lt;!-- The red value for the color table entry --&gt;
 119           &lt;!-- Data type: Integer --&gt;
 120           &lt;!-- Min value: 0 (inclusive) --&gt;
 121           &lt;!-- Max value: 255 (inclusive) --&gt;
 122         &lt;!ATTLIST "ColorTableEntry" "green" #CDATA #REQUIRED&gt;
 123           &lt;!-- The green value for the color table entry --&gt;
 124           &lt;!-- Data type: Integer --&gt;
 125           &lt;!-- Min value: 0 (inclusive) --&gt;
 126           &lt;!-- Max value: 255 (inclusive) --&gt;
 127         &lt;!ATTLIST "ColorTableEntry" "blue" #CDATA #REQUIRED&gt;
 128           &lt;!-- The blue value for the color table entry --&gt;
 129           &lt;!-- Data type: Integer --&gt;
 130           &lt;!-- Min value: 0 (inclusive) --&gt;
 131           &lt;!-- Max value: 255 (inclusive) --&gt;
 132 ]&gt;
 133 </pre>
 134 <a id="gif_image_metadata_format"></a>
 135 <h2>GIF Image Metadata Format Specification</h2>


 136 <p>
 137 
 138 The GIF image metadata format encodes the image descriptor, local
 139 color table, and extension information assciated with a single image
 140 within a GIF file, typically a frame of an animation.
 141 
 142 <p>
 143 
 144 The image description contains the offset of the frame within the
 145 logical screen described in the stream metadata, as well as the width
 146 and height of the frame and whether it is used interlaced encoding.
 147 
 148 <p>
 149 
 150 The local color table, if present, supersedes the global color table
 151 for the frame at hand.
 152 
 153 <p>
 154 
 155 The graphic control extension contains information on how the frame is


 327           &lt;!-- Data type: String --&gt;
 328         &lt;!ATTLIST "ApplicationExtension" "authenticationCode" #CDATA
 329            #REQUIRED&gt;
 330           &lt;!-- The authentication code --&gt;
 331           &lt;!-- Data type: String --&gt;
 332 
 333     &lt;!ELEMENT "CommentExtensions" (CommentExtension)*&gt;
 334       &lt;!-- A set of comments --&gt;
 335       &lt;!-- Min children: 1 --&gt;
 336       &lt;!-- Max children: 2147483647 --&gt;
 337 
 338       &lt;!ELEMENT "CommentExtension" EMPTY&gt;
 339         &lt;!-- A comment --&gt;
 340         &lt;!ATTLIST "CommentExtension" "value" #CDATA #REQUIRED&gt;
 341           &lt;!-- The comment --&gt;
 342           &lt;!-- Data type: String --&gt;
 343 ]&gt;
 344 </pre>
 345 
 346 <p>
 347 <a id="mapping"></a>

 348 <table border=1>
 349 <caption><b>Mapping of Standard to GIF Native Stream Metadata</b></caption>
 350 <tr>
 351 <th>Standard Metadata Component</th>
 352 <th>GIF Native Stream Metadata Component</th>
 353 </tr>
 354 <tr>
 355 <td>/Chroma/Palette/PaletteEntry@index</td>
 356 <td>/GlobalColorTable/ColorTableEntry@index</td>
 357 </tr>
 358 <tr>
 359 <td>/Chroma/Palette/PaletteEntry@red</td>
 360 <td>/GlobalColorTable/ColorTableEntry@red</td>
 361 </tr>
 362 <tr>
 363 <td>/Chroma/Palette/PaletteEntry@green</td>
 364 <td>/GlobalColorTable/ColorTableEntry@green</td>
 365 </tr>
 366 <tr>
 367 <td>/Chroma/Palette/PaletteEntry@blue</td>


 375 <td>/Data/BitsPerSample@value</td>
 376 <td>/LogicalScreenDescriptor@colorResolution</td>
 377 </tr>
 378 <tr>
 379 <td>/Dimension/PixelAspectRatio@value</td>
 380 <td>/LogicalScreenDescriptor@pixelAspectRatio</td>
 381 </tr>
 382 <tr>
 383 <td>/Dimension/HorizontalScreenSize@value</td>
 384 <td>/LogicalScreenDescriptor@logicalScreenWidth</td>
 385 </tr>
 386 <tr>
 387 <td>/Dimension/VerticalScreenSize@value</td>
 388 <td>/LogicalScreenDescriptor@logicalScreenHeight</td>
 389 </tr>
 390 <tr>
 391 <td>/Document/FormatVersion@value</td>
 392 <td>/Version@value</td>
 393 </tr>
 394 </table>

 395 

 396 <table border=1>
 397 <caption><b>Mapping of Standard to GIF Native Image Metadata</b></caption>
 398 <tr>
 399 <th>Standard Metadata Component</th>
 400 <th>GIF Native Image Metadata Component</th>
 401 </tr>
 402 <tr>
 403 <td>/Chroma/Palette/PaletteEntry@index</td>
 404 <td>/LocalColorTable/ColorTableEntry@index</td>
 405 </tr>
 406 <tr>
 407 <td>/Chroma/Palette/PaletteEntry@red</td>
 408 <td>/LocalColorTable/ColorTableEntry@red</td>
 409 </tr>
 410 <tr>
 411 <td>/Chroma/Palette/PaletteEntry@green</td>
 412 <td>/LocalColorTable/ColorTableEntry@green</td>
 413 </tr>
 414 <tr>
 415 <td>/Chroma/Palette/PaletteEntry@blue</td>


 417 </tr>
 418 <tr>
 419 <td>/Dimension/HorizontalPixelOffset@value</td>
 420 <td>/ImageDescriptor@imageLeftPosition</td>
 421 </tr>
 422 <tr>
 423 <td>/Dimension/VerticalPixelOffset@value</td>
 424 <td>/ImageDescriptor@imageTopPosition</td>
 425 </tr>
 426 <tr>
 427 <td>/Text/TextEntry@value</td>
 428 <td>/CommentExtensions/CommentExtension@value</td>
 429 </tr>
 430 <tr>
 431 <td>/Transparency/TransparentIndex@value</td>
 432 <td>/GraphicControlExtension@transparentColorIndex
 433 (/GraphicControlExtension@transparentColorFlag is also set to
 434 "TRUE")</td>
 435 </tr>
 436 </table>

 437 
 438 </body>
 439 </html>
< prev index next >