Klaus Junge: GIF-Dateiformat (3=Palette)

Beitrag lesen

Hallo Cheatah,

nur mal kurz zwischendurch das Kapitel Palette aus GIF89a.TXT.
Du hast das wohl schon intus, der Vollständigkeit halber aber doch noch.

19. Global Color Table.

a. Description. This block contains a color table, which is a sequence of
      bytes representing red-green-blue color triplets. The Global Color Table
      is used by images without a Local Color Table and by Plain Text
      Extensions. Its presence is marked by the Global Color Table Flag being
      set to 1 in the Logical Screen Descriptor; if present, it immediately
      follows the Logical Screen Descriptor and contains a number of bytes
      equal to
                    3 x 2^(Size of Global Color Table+1).

This block is OPTIONAL; at most one Global Color Table may be present
      per Data Stream.

Das ist also eine einfache byteorientierte Tabelle, bestehend aus RGB-Triplets.
Wer auch nur ein wenig HTML drauf hat, beherrscht somit die Definitionsgrundlagen.
Diese Tabelle darf nur vorhanden sein wenn das Bit oben im Descriptor gesetzt ist,
oder umgekehrt, wenn die Tabelle vorhanden ist, muß das Bit gesetz sein (+ Größe).

GLOBAL COLOR TABLE FLAG BEING SET TO 1 IN THE LOGICAL SCREEN DESCRIPTOR

Die Tabelle kann und darf maximal einmal vorhanden sein (also 0..1 mal).

Außerdem ist es unbedingt erforderlich die richtige Größe im
LOGICAL SCREEN DESCRIPTOR = 3 x 2^(Size of Global Color Table+1)
in jenem <Packed Fields>-Feld Bits_2..0 einzutragen.

Die Palette muß, wenn vorhanden unmittelbar hinter dem
LOGICAL SCREEN DESCRIPTOR untergebracht sein.

Den Aspekt Plain Text vernachlässige ich mal geflissentlich; für den
Bau von GIFs zunächst unwesentlich, fürs Einlesen vielleicht doch.

b. Required Version.  87a

c. Syntax.

7 6 5 4 3 2 1 0        Field Name                    Type
         +===============+
      0  |               |       Red 0                         Byte
         +-             -+
      1  |               |       Green 0                       Byte
         +-             -+
      2  |               |       Blue 0                        Byte
         +-             -+
      3  |               |       Red 1                         Byte
         +-             -+
         |               |       Green 1                       Byte
         +-             -+
     up  |               |
         +-   . . . .   -+       ...
     to  |               |
         +-             -+
         |               |       Green 255                     Byte
         +-             -+
    767  |               |       Blue 255                      Byte
         +===============+

d. Extensions and Scope. The scope of this block is the entire Data
      Stream. This block cannot be modified by any extension.

e. Recommendation. None.

Dieses Thema ist also kurz und trivial.

Klaus

0 50

GIF-Dateiformat (1)

Klaus Junge
  1. 0

    GIF-Dateiformat (2)

    Klaus Junge
    1. 0
      Cheatah
      1. 0
        m0b
        1. 0
          m0b
          1. 0
            Cheatah
          2. 0
            Stefan Muenz
            1. 0
              Cheatah
    2. 0
      Cheatah
      1. 0
        Klaus Junge
        1. 0
          Klaus Junge
          1. 0
            Cheatah
            1. 0
              Klaus Junge
              1. 0
                Cheatah
    3. 0

      GIF-Dateiformat (2a)

      Klaus Junge
      1. 0
        Cheatah
        1. 0
          Klaus Junge
          1. 0
            Cheatah
            1. 0
              Klaus Junge
              1. 0
                Cheatah
              2. 0
                Calocybe
                1. 0
                  Cheatah
                  1. 0
                    Calocybe
                    1. 0
                      Cheatah
                      1. 0
                        Calocybe
        2. 0
          Jörk Behrends
  2. 0
    Olaf Grönemann
  3. 0

    GIF-Dateiformat (k1)

    Klaus Junge
    1. 0

      GIF-Dateiformat (k2)

      Klaus Junge
      1. 0
        Cheatah
        1. 0
          Klaus Junge
          1. 0
            Cheatah
      2. 0

        GIF-Dateiformat (k3)

        Klaus Junge
        1. 0
          Cheatah
        2. 0

          GIF-Dateiformat (k4)

          Klaus Junge
  4. 0

    GIF-Dateiformat (3=Palette)

    Klaus Junge
    1. 0
      Cheatah
      1. 0
        Klaus Junge
        1. 0
          Cheatah
  5. 0

    Aktueller Stand der Dinge

    Cheatah
    1. 0
      Klaus Junge
      1. 0
        Cheatah
      2. 0
        Calocybe
        1. 0
          Cheatah
  6. 0

    GIF-Dateiformat (test_1)

    Klaus Junge
    1. 0
      Cheatah
      1. 0
        Klaus Junge
        1. 0
          Klaus Junge
          1. 0
            Calocybe
          2. 0
            Cheatah