2. Preparing your Images for the Web
| Chapter 6. Getting Images out of GIMP |

## 2. Preparing your Images for the Web

One of the most common purposes GIMP is used for is to prepare images for adding them to a web site. This means that images should look as nice as possible while keeping the file size as small as possible. This little step-by-step guide will tell you how to achieve a smaller file size with minimal degradation of image quality.

### 2.1. Images with an Optimal Size/Quality Ratio

An optimal image for the web depends upon the image type and the file format you have to use. If you want to put a photograph with a lot of colors online, you have to use JPEG as your primary file format. If your image contains fewer colors, that is, if it is not a photograph, but is more a drawing you created (such as a button or a screenshot), you would be better off using PNG format. We will guide you through the process of doing this.

1. First, open the image as usual. I have opened our Wilber as an example image.

   Figure 6.6. The Wilber image opened in RGBA mode

2. The image is now in RGB mode, with an additional Alpha channel (RGBA). There is usually no need to have an alpha channel for your web image. You can remove the alpha channel by flattening the image.

   If you open a photograph, you probably won't have to remove the alpha channel, because a photograph doesn't usually have one, so the file is already opened in RGB mode.

   | Note
   If the image has a soft transition into the transparent areas, you cannot remove the alpha channel, since the information which would be used for fading out will not be saved in the file. If you would like to save an image with transparent areas which do not have a soft transition, (similar to GIF), you can remove the alpha channel.

3. After you have flattened the image, you are able to save the image in PNG format for your web site.

| Note

You can save your image in PNG format with the default settings, but using maximum compression. Doing this will have no negative affects on the quality of the picture, as it would have with JPEG format. If your image is a photograph with lots of colors, you would be better off saving it as jpeg. The main thing is to find the best tradeoff between quality and compression. You can find more information about this topic in Section 1.2.2, “Saving as JPEG”.

Chapter 6. Getting Images out of GIMP |  | 2.2. Reducing the File Size Even More