Re: resizing gifs

Subject: Re: resizing gifs
From: Dick Margulis <margulis -at- fiam -dot- net>
To: c -dot- sharp -at- meridio -dot- com, TECHWR-L <techwr-l -at- lists -dot- raycomm -dot- com>
Date: Wed, 11 Feb 2004 10:38:38 -0500


You read through the other responses, but because I posted a recipe rather than an explanation, you failed to see that I already offered this solution when I said to first convert the image color mode to RGB and then to Save As GIF.

Here's the explanation: GIFs are run-length encoded using indexed color. Indexed color means that each pixel can only be one of 256 color and thus each pixel can only require an 8-bit byte to encode it. Pixel 1 is color 17, for example. The colors are stored in a table of up to 256 24-bit words, each of which encodes RGB values between 0 and 255 (one byte for the R value, one byte for the G value, one byte for the B value).

Run-length encoded that means is that instead of using one byte per pixel, it specifies a color from the table (number 17, say) and then says how many pixels are that color before changing to another color. So if you have a horizontal stripe of a constant color, the GIF only has to specify the color once and then just add another byte to say that the color applies to the next 39 pixels, for example, yielding further compression. (This works only in horizontal solids. Vertical stripes don't afford much in the way of compression.)

When an RGB image is converted to GIF, all those subtle shades have to be reduced to the most prominent 256 colors. The process is called dithering and the result is a dithered imaged. Think about what it means to dither. Do I want the apple pie or the chocolate cake? Pie or cake, pie or cake, pie or cake. Gee, I can't make up my mind. Picture my head swinging side to side while I choose. That's dithering (the original meaning). Well, it's the same thing here. I'm really chartreuse. Should I be yellow or should I be green? I can't decide, so I'll be half yellow and half green (by coloring adjacent pixels different colors to average the target color).


c -dot- sharp -at- meridio -dot- com wrote:

I've read through the other answers to this, and there's something
no-one's mentioned, but I've found beneficial when resizing.

GIFS are 256-colour (8 bit images). If, in whatever application you're
using (I'm a PaintShop user), boost this up to 16 million colours (16 bit)
before resizing, you'll get a better quality image, even though it's
reduced back down to 256 colours when you save it as a GIF.

I can't think how to technically explain why this works (fine tech writer
/I/ am!) but it's basically due to the way any blurred parts of the image
change in colour when they're resized. Using 16 million colours allows for
smaller differences in colour between area.

[This E-mail scanned for viruses at]

Previous by Author: Re: resizing gifs
Next by Author: Re: Adobe Creative Suite's Design Guide or Scenarios instead of Manuals
Previous by Thread: Re: resizing gifs
Next by Thread: Re: resizing gifs

What this post helpful? Share it with friends and colleagues:

Sponsored Ads