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