[comp.sys.ibm.pc] GIF File Format

ian@media.UUCP (Ian Poynter) (02/04/89)

I have been asked by someone in our company who does not have access to news 
to post this question.  Please direct all responses either to me by e-mail
or to comp.graphics, since I don't read comp.sys.ibm.pc.

Thanks.

The following is an excerpt from the GIF image format specification:

 SCREEN DESCRIPTOR

        The Screen Descriptor describes the overall parameters for all  GIF
   images  following.  It defines the overall dimensions of the image space
   or logical screen required, the existence of color mapping  information,
   background  screen color, and color depth information.  This information
   is stored in a series of 8-bit bytes as described below.

              bits
         7 6 5 4 3 2 1 0  Byte #
        +---------------+
        |               |  1
        +-Screen Width -+      Raster width in pixels (LSB first)
        |               |  2
        +---------------+
        |               |  3
        +-Screen Height-+      Raster height in pixels (LSB first)
        |               |  4
        +-+-----+-+-----+      M = 1, Global color map follows Descriptor
        |M|  cr |0|pixel|  5   cr+1 = # bits of color resolution
        +-+-----+-+-----+      pixel+1 = # bits/pixel in image
        |   background  |  6   background=Color index of screen background
        +---------------+          (color is defined from the Global color
        |0 0 0 0 0 0 0 0|  7        map or default map if none specified)
        +---------------+

Unfortunately, the document does not specify anywhere what is meant by
"Color Resolution."  It does not appear to mean what comes to mind, i. e.
color resolution of 0 implying 2 ** 1 colors, 1 meaning 2 ** 2 ...
This poses no problem in reading a GIF file, as all necessary information is
provided elsewhere but it remains unclear what value to enter into this
field when writing out an image.

I would appreciate any clarification I can get.

-- 
Ian (I answer *all* mail) Poynter		Phone: +1 (301) 495-3305
UUCP: ..!{mimsy,sundc}!{prometheus,hqda-ai}!media!ian
Internet: (new) ian%media@pentagon-ai.army.mil (but too new to work?)
	  (old) ian%media@hqda-ai.arpa (going away real soon now)

john@cooper.cooper.EDU (John Barkaus) (03/28/89)

Hi,

	I would like information on the format of .GIF files.
If there is any interest, I will post what I find out.

	Thanks in advance.
				John

         John M. Barkaus at the Cooper Union, NY, NY.
           INTERNET: john%cooper.cooper.edu@cmcl2.nyu.edu
                   UUCP: cmcl2!cooper!john

davidsen@steinmetz.ge.com (Wm. E. Davidsen Jr) (03/30/89)

In article <1479@cooper.cooper.EDU> john@cooper.cooper.EDU (John Barkaus) writes:

| 	I would like information on the format of .GIF files.
| If there is any interest, I will post what I find out.

  The GIF standard is in the GIF section of *IX BBS

  System	sixhub (*IX BBS)
  Phone		518-346-8033
  login		bbs
  board		mbs
  area		GIF
-- 
	bill davidsen		(wedu@crd.GE.COM)
  {uunet | philabs}!steinmetz!crdos1!davidsen
"Stupidity, like virtue, is its own reward" -me

macs3440@rocky.oswego.edu (Craig Siegelson) (03/30/89)

   Can anyone supply me with a list of systems connected to this
   NETwork?

   I know the list may be very extensive, but if anyone can mail me a copy
   or post me a copy.

   Thanx.....

         Craig R. Siegelson
     
             macs3440@rocky.Oswego.EDU

porges@inmet.UUCP (03/31/89)

/* Written  8:42 pm  Mar 27, 1989 by john@cooper.UUCP in comp.sys.ibm.pc */
>Hi,

>I would like information on the format of .GIF files.
>If there is any interest, I will post what I find out.

    My understanding is that GIF is proprietary information of Compuserve, and
that they don't let just anyone know the format.  In order to know it, you
have to become a "GIF developer" and sign a non-disclosure agreement.

					-- Don Porges
					porges@inmet.com
					{...mirror,ima}!inmet!porges

sekoppenhoef@rose.waterloo.edu (04/01/89)

In article <149000030@inmet> porges@inmet.UUCP writes:
 :>I would like information on the format of .GIF files.
 :>If there is any interest, I will post what I find out.

 :have to become a "GIF developer" and sign a non-disclosure agreement.

Not true! The GIF format specs can be ftp'd anonymously from 
uscd.uscd.edu (128.54.16.1) in the /pub/graphics directory along with a bunch
of other interesting stuff... the TIFF format can be found there too!

______________________________________________________________________________
Shawn Koppenhoefer  CS C&O, University of Waterloo, Canada N2L 3G1       _ _  
                    sekoppenhoef@waterloo  { .CSNET or .CDN or .EDU }     < 
Klein bottle for sale...  enquire within                                  -

usenet@agate.BERKELEY.EDU (USENET Administrator) (04/02/89)

From: air@anableps.berkeley.edu (Arthur Ernest Wright)
Path: anableps.berkeley.edu!air


People's Technology | Participating in the war on apathy, ingnorance, and 
Arthur Ernest Wright| Stagnation, while simultaneusly ___    ___    ___
1272 Willamette #404| working in the retail computer X@ @X  (@ @)  (X X)
Eugene, Oregon 97401| equiptment nightmare.           \o/    \X/    \o/
(503) 344-7969      | air@mica.berkeley.edu          Deaf   Dumb   Blind

johnm@trsvax.UUCP (04/04/89)

>>Hi,
>>
>>I would like information on the format of .GIF files.
>>If there is any interest, I will post what I find out.
>
>    My understanding is that GIF is proprietary information of Compuserve, and
>that they don't let just anyone know the format.  In order to know it, you
>have to become a "GIF developer" and sign a non-disclosure agreement.
>
>					-- Don Porges
>					porges@inmet.com
>					{...mirror,ima}!inmet!porges

Wrong.

The only thing you get by becoming a GIF developer is access to another
message area and data library in the PICS section on Compu$erve.  This gives
you access to source code for a variety of decoders/encoders and whatnot.  The
specification for the file format itself is freely distributable.

John Munsch

pthiesse@jarthur.Claremont.EDU (Paul Thiessen) (04/06/89)

In article <149000030@inmet> you write:
>
>    My understanding is that GIF is proprietary information of Compuserve, and
>that they don't let just anyone know the format.  In order to know it, you
>have to become a "GIF developer" and sign a non-disclosure agreement.
>
>					-- Don Porges
>					porges@inmet.com
>					{...mirror,ima}!inmet!porges

Actually, getting information is free and easy! For example, on Simtel20,
there is <msdos.gif>gifdoc.arc which has a big text document on the GIF
format, and several example programs, source and executable, that deal with
GIF pictures.
  I'd say it's better for CompuServe to have released their format, so other
people can create GIF pictures. It wouldn't be much of a "Graphics Interchange
Format" if no one else could use it! :-)

         - Paul

-- 
----------------------------------------------------------------------------
PAUL THIESSEN, Harvey Mudd College                ...!uunet!jarthur!pthiesse
pthiesse@jarthur.claremont.edu                       pthiessen@hmcvax.bitnet
----------------------------------------------------------------------------

cs__sjh@umt.UUCP (Jeffrey Heng) (05/02/90)

Does anyone out there have the specifications of GIF file formats? How
many colors is a GIF file able to store?  I've used a program to convert
GIF files to TARGA-16 files and the converted TARGA-16 files are much ,
much bigger than GIF files.  A friend suggested looking into CompuServe
for the GIF file format, but I do not have access to CompuServe.  If
anyone could post the GIF specifications, it would be greatly appreciated.
Thanks.   

rosen@polar.bu.edu (David B. Rosen) (05/04/90)

I don't have the GIF Format, but I know why it's smaller: it's
compressed! As I understand it, the GIF file format has LZW (Lempel
Ziv Welch) compression (like unix compress) built in. If you use a
standard compression utility on your TARGA-16 files, they may end up
about the same size as the GIF file (unless TARGA-16 has an internal
structure that would make it relatively incompressible on a
byte-string basis).  LZ algorithms are somewhat subtle, but they rely
on the encoder and the decoder each building up the same dictionary of
frequently-occuring strings of arbitrary length, where each string is
represented as a fixed-size codeword (typically 16 bits or less) in
the compressed data stream.

--
David B Rosen,  Cognitive & Neural Systems               rosen@bucasb.bu.edu
Center for Adaptive Systems                    Bitnet: rosen%thalamus@buacca
Boston University                  UUCP: {harvard,uunet}!bu.edu!bucasb!rosen

raveling@isi.edu (Paul Raveling) (05/08/90)

In article <ROSEN.90May3192224@polar.bu.edu>, rosen@polar.bu.edu (David
B. Rosen) writes:
> I don't have the GIF Format, but I know why it's smaller: it's
> compressed! As I understand it, the GIF file format has LZW (Lempel
> Ziv Welch) compression (like unix compress) built in. If you use a
> standard compression utility on your TARGA-16 files, they may end up
> about the same size as the GIF file...

	That's true.  When the Img Software Set writes an image file
	by default it pipes it through compress; the resulting file
	is about the same size as a corresponding GIF file.  Most
	are very slightly smaller, probably because the entire file
	(header included) is compressed.  I believe Jef Poskanzer
	has reported similar results for the PBM software.

	I like the idea of compressing the entire file rather than
	having compression/decompression logic embedded in software
	that reads or writes the files for 2 reasons:

	    1.  When the entire file is compressed, it's possible
		to use existing tools to manipulate it (for example,
		"zcat file | favorite_dump_utility), rather than
		having to write specialized tools.

	    2.  Software to read and write the files is simpler.

	The ideal would probably be to have the OS disk i/o functions
	automatically do compression/decompression.  Best would be
	to add a hardware assist -- it shouldn't take much silicon
	to do this EXTREMELY fast and to make that process invisible
	to even OS software.


----------------
Paul Raveling
Raveling@isi.edu