Speciale  StradaNove - il settimanale digitale StradaNove .netArt - la rivista italiana di web design
anno 2 - numero 03 - maggio 2000

. .
.

GIF, this well-known

The CompuServe Graphics Interchange Format is an extremely compressed format, created 'ad hoc' for the Web. In this format the colour depth is limited: from a minimum of 1 bit (2 colours) to a maximum of 8 bit (256 colours, the 28); if 256 colours seem too few, the GIF format helps us, making possible to optimise the palette of the colours, taking into account our needs; practically, the colours can be up to 256, but the 256 which *we* choose.

The algorithm of compression used in the GIF format is called LZW (from the authors, mister Lemple, Zif and Welch) and it is of the 'loss-less' type: if the source image does not have more than 256 colours, the image saved in this format will be absolutely identical to the original.

The main trick used in the GIF format to reduce drastically the dimensions of the file consists in storing the information this way: 'the next twenty pixels are white, than there are some green and the 37 red' and so on, instead of storing the colour of every single pixel. Evidently, this way is possible to use less bytes, and the more there are pixel of the same colour one near each other, the less is the file's size. This system works for lines, not for columns, so the one dimension to take in consideration is the horizontal one, since the vertical shifts don't affect the file size.

Images with large areas of a uniform colour and areas with few colours will have the greatest advantages with this system, while in the limit case of an image without neither two consecutive pixels of the same colour, we will arrive at the logic absurd of a compression which is, in reality, an expansion of the file size. This limit case anyway, is not so rare: when I say 'consecutive pixel of the same colour', in fact, I mean EXACTLY of the same colour, a fact that in a dithered image is not so uncommon.

go on...



1. Presentation vs. content: Graphic Formats
2. GIF, this well-known
3. JPEG and JPEG2000, photorealism over the Web
4. GIF vs. JPG

.

Leggi questo articolo in Italiano

 


(GIF 128 colors, dithering at 100%, 6896 byte)


(GIF 64 colors, no dithering, 4341 byte)


(GIF 16 colori, no dithering, 2191 byte)

.

http://netart.stradanove.net/
Anno 2 - Numero 3 - Maggio 2000
© Copyright 1999-2000 Frederic Argazzi e Antonio Cavedoni

.