• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 18. Optimization > GIF Compression

GIF Compression

GIF is an acronym that stands for Graphics Interchange Format. It's a file format designed for saving images that contain large areas of solid color (what I call graphics). GIF achieves a small file size by dividing the image into one-pixel-tall horizontal strips. Then it analyzes those strips and looks to see if any adjacent colors are exactly the same. If it finds same-colored areas, it can compress them by describing them in a more efficient way. So, instead of describing every single pixel (red pixel, red pixel, red pixel, red pixel, red pixel), it can describe it as a solid colored line (red pixel x 5). This can save considerable space on your hard drive as long as there are lots of solid-colored areas in the image. In order to guarantee some file size savings, the GIF format limits your images to 256 colors or less (also known as indexed color mode). If you want to get a sense for how GIF thinks about your image, open the same image you blurred earlier, choose Image > Adjust > Posterize, and use a low number like 2 (Figure 18.2). This will reduce the number of colors in your image, and you should notice that more areas of solid color appear. You should also notice that photographic areas don't look so good, but graphical areas (logos, text, bar charts, etc.) generally look fine. So now you should be able to see why GIF is mainly used to compress graphics.

Figure 18.2. Left: original image. Right: posterized with a setting of 2.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint