Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!mit-eddie!uw-beaver!blake!wiml From: wiml@blake.acs.washington.edu (William Lewis) Newsgroups: comp.graphics Subject: Re: GIF decoding info Summary: Terminology problems? Message-ID: <2736@blake.acs.washington.edu> Date: 11 Jul 89 05:45:34 GMT References: <3718@cps3xx.UUCP> <2716@blake.acs.washington.edu> <3726@cps3xx.UUCP> Reply-To: wiml@blake.acs.washington.edu (William Lewis) Distribution: comp Organization: University of Washington, Seattle Lines: 44 In article <3726@cps3xx.UUCP> dulimart@cpsvax.UUCP (Hansye S. Dulimarta) writes: >Unfortunately, I got the when the image is not complete and at about the >end of the _first_ raster block (there are at least four raster blocks, I knwo >this because I develop my program in "debugging" mode by printing out >information I got from the file). >You said that when I get the code I'm done with the image. DO you mean >that I'm done with the current raster block or done with the entire image ? I'm not sure we're using the same terminology. My .gif docs refer to an "image" as a rectangualr block of pixels. A .gif file can contain more than one image, though. (Most contain only one, I have found...) Is this what you mean by a "raster block"? If you stopped the program at the end of the first raster block, would you have a square bitmap onscreen, or an unfinished bitmap with a possibly incomplete line..? When you increase the compression size, the CC and EOI and such codes should remain constant, because they are always the first empty values above the "primitive" values... Consider the following string table: (Four-color image) Code Value 0 A 1 B 2 C 3 D 4 5 6 (first LZW code, possibly CB) 7 (next LZW code...) When you increase the code size, you do not alter the table in any way. You merely output one more bit per code, because the code values are getting large enough that it takes more bits to represent them. For a good discussion on LZW coding in general, see ieee COMPUTER June 1984 (Vol. 17, Number 6) "A Technique for High-Performance Data Compression", by Terry A. Welch. (The name sound familiar? =8) =8) ) --- phelliax "I'm not a GIF decoder, but I play one on Usenet" > >I also follow the documentation which says that whenever the string table is >filled up I have to increase the "compression size" by one bit. When I do >this, is it necessary to recalculate the and code ?