Originally Posted by
doggy
so far i have ripped a gif file to hex and been able to decode the following which is a 10x10 black square,then a10x10 blue square, hex looks like this:
47 49 46 38 39 61 // header gif type
0A 00 - logical screen width in pixels
0A 00 - logical screen height in pixels
99 - GCT follows for 256 colors with resolution 3 x 8 bits/primary
01 - background color #0
00 - default pixel aspect ratio
00 00 01 Global Color Table
00 00 FF
00 00 00
00 00 00
21 F9 - Graphic Control Extension
04 05 36 00 - 4 bytes of GCE data follow
02 - transparent background color
00 21 - delay for animation: not used
FF - color #ff is transparent
0B - end of GCE block
4E 45 54 53 43 41 50 45 32 2E 30 //netscape 2.0
03 -(hex 0x03) Length of Data Sub-BlocK (three bytes of data to follow)
01 - 1 (hex 0x01)
61 00 - LOOP INTEGER / BACKWARDS
00 - SUB BLOCK TERMINATOR
start of imagery
2C -Image Descriptor
00 00 00 00 - NW corner position of image in logical screen
0A 00 0A 00 - image width and height in pixels
00 - no local color table
-------------------------------------------------------------but--------------------------------------------------------
it is this line of compressed image data thats got me, since it is the first image it will be a 10x10 black square:
02 - Start of image - LZW minimum code size BLck
08 84 8F - 11 bytes of LZW encoded image data follow
A9 CB ED
0F 63 2B
00 sub block terminator in effect
first i am confused to how the output code will look, since black is color table 1, and image is 10x10, i have understood that output code will look like this
0A 01 0A 01 0A 01 0A 01
0A 01 0A 01 0A 01 0A 01
0A 01 0A 01
is that correct? ten pixles of 1's for each line, or should it be 64 01's(64 being hex100)?
i still dont see how
02 08 84 8F A9 CB ED 0F 63 2B 00
expands to 0a 01 0a 01 0a 01 0a 01 0a 01 0a 01 0a 01 0a 01 0a 01 0a 01
or 64 01,
ALSO i dont need code specifically i just need to figure out how to do it on paper, that is partial to why i kept my example gif so small