Re: is the size of a gif = sum of its parts?

by Chris Messina <cmessina(at)sandstormpublishing.com>

 Date:  Tue, 14 Apr 1998 20:10:17 -0400
 To:  HWG-GRAPHICS(at)hwg.org
 In-Reply-To:  rhodes
  todo: View Thread, Original
<SNIP>
>If you have one large gif that consists of a black background with six 
>vertically aligned red rectangles with white anti-aliased text on them,
>will the file size of this large gif be the same as the sum of the file
>sizes of six smaller gifs, each one consisting of one of the rectangles 
>and immediately surrounding background of the larger gif?
</SNIP>


I am by no means a GIF afficionado, but I think I can shed some light on
this subject based on what I've heard and seen around the web. 

[Disclaimer: Correct me if I'm wrong fellow gurus]

A GIF image has a maximum of 256 colors. Those colors can be any
combination of solids or transparencies. The fewer the colors, the smaller
the filesize. The fewer horizontal changes in the image, the smaller it
will be (lesser so for vertical changes).

Thus, say you have an image with alternating bars of color like so:
 _________
| | | | | |
| | | | | |
| | | | | |
|_|_|_|_|_|

That image will take up more space than if you have an image that
alternates vertically:

 _________
|_________|
|_________|
|_________|
|_________|
|_________|

Don't ask me why, my job is to emply what I know, not to necessarily
understand all of it.

That's why you can have an image that is 1 pixel wide by 5000 pixels tall
with only four colors take up a total of 150 bytes whereas a an image 1300
wide by 1 pixel high with 8 colors takes up only 110 bytes... even though
it's smaller, notice that its more than 3500 pixels smaller. I hope that
answers your question... I'll step back now and let the rest tell the truth!



Chris Messina
Webmaster -|- Sandstorm Publishing
http://www.sandstormpublishing.com
http://www.sandstormpublishing.com/thecloset

HWG: hwg-graphics mailing list archives, maintained by Webmasters @ IWA