OT: reducing gif

Greg Hamilton yellowdog-general@lists.terrasoftsolutions.com
Thu May 13 22:23:01 2004


The GIF format uses LZW compression. It applies a fancy variation on 
run length encoding to horizontal lines of pixels in the image. 
Repeated pixel values on a line can be reduced to a pixel colour value 
and a count. If you reduce the width of the image then I suppose, for 
some image, the amount of compression than can be achieved is also 
reduced.

Of course that doesn't explain the picture getting bigger. Perhaps the 
resize algorithm applied dithering which significantly reduced the 
horizontal colour repetition. Or maybe the bit depth of the image was 
increased.

This explains how GIF works.

http://www.radzone.org/tutorials/gifcomp.html

Unisys hold a patent on the LZW compression algorithm and like to 
charge a per-copy fee for programs which use the algorithm. PNG is a 
Free alternative which provides similar loss-less compression.

Greg

On 14/05/2004, at 12:05 PM, admin@datazap.net wrote:

> Hi,
>
> I was wonder if someone could help me with this. I am trying to reduce 
> the
> file size of gif images. I thought that if I reduced the size of the 
> image
> (the number of pixels) that it would also reduce its file size.
>
> This is what have I done:
>
> agnus: {18} gifrsize -s 0.8 Picture1.gif > Picture1_scale.gif
> agnus: {19} ll
>
> -rw-r--r--  1 azick  wheel  10635 May  4 10:48 Picture1.gif
> -rw-r--r--  1 azick  wheel  24570 May 13 14:22 Picture1_scale.gif
>
> The image that I reduced is now has a file size of over twice the size 
> of
> the original. Does anyone know why, and what I can do to make it 
> smaller?
>
> Thanks,
> Al
>
>
> _______________________________________________
> yellowdog-general mailing list
> yellowdog-general@lists.terrasoftsolutions.com
> http://lists.terrasoftsolutions.com/mailman/listinfo/yellowdog-general
> HINT: to Google archives, try  '<keywords> site:terrasoftsolutions.com'
>