Äîêóìåíò âçÿò èç êýøà ïîèñêîâîé ìàøèíû. Àäðåñ îðèãèíàëüíîãî äîêóìåíòà : http://uneex.lorien.cs.msu.su/static/GimpDoc_EnRu/en/gimp-images-in.html
Äàòà èçìåíåíèÿ: Mon Sep 26 12:35:50 2011
Äàòà èíäåêñèðîâàíèÿ: Tue Oct 2 14:27:18 2012
Êîäèðîâêà: IBM-866
Chapterˆà5.ˆà Getting images into GIMP

Chapterˆà5.ˆà Getting images into GIMP

Table of Contents

1. Image types
2. Working with Images
2.1. Creating new Files
2.2. Opening Files

1.ˆà Image types

It is tempting to think of an image as something that corresponds with a single display window, or to a single file such as a JPEG file, but really a GIMP image is a rather complicated structure, containing a stack of layers plus several other types of objects: a selection mask, a set of channels, a set of paths, an "undo" history, etc. In this section we are going to take a detailed look at all of the components of an image, and the things you can do with them.

The most basic property of an image is its mode. There are three possible modes: RGB, grayscale, and indexed. RGB stands for Red-Green-Blue, and indicates that each point in the image is represented by a òÀÜredòÀÝ level, a òÀÜgreenòÀÝ level, and a òÀÜblueòÀÝ level. Because every humanly distinguishable color can be represented as a combination of red, green, and blue, RGB images are full-color. Each color channel has 256 possible intensity levels. More details in Color Models

In a grayscale image, each point is represented by a brightness value, ranging from 0 (black) to 255 (white), with intermediate values representing different levels of gray.

Figureˆà5.1.ˆà Components of the RGB and CMY color model

Components of the RGB and CMY color model

In the RGB Color Model, mixing Red, Green and Blue gives White. That's what hapeens on your screen.

Components of the RGB and CMY color model

In the CMY(K) color model, mixing Cyan, Magenta and Yellow gives Black. That's what happen's when you print on a white paper. The printer will actually use the black cartridge for economical reasons and better color rendering.


Essentially the difference between a grayscale image and an RGB image is the number of òÀÜcolor channelsòÀÝ: a grayscale image has one; an RGB image has three. An RGB image can be thought of as three superimposed grayscale images, one colored red, one green, and one blue.

Actually, both RGB and grayscale images have one additional color channel, called the alpha channel, representing opacity. When the alpha value at a given location in a given layer is zero, the layer is completely transparent, and the color at that location is determined by what lies underneath. When alpha is maximal, the layer is opaque, and the color is determined by the color of the layer. Intermediate alpha values correspond to varying degrees of translucency: the color at the location is a proportional mixture of color from the layer and color from underneath.

Figureˆà5.2.ˆà Example of an image in RGB and Grayscale mode

Example of an image in RGB and Grayscale mode

An image in RGB mode, with the channels corresponding to Red, Green and Blue.

Example of an image in RGB and Grayscale mode

An image in Grayscale mode, with the channel corresponding to Luminosity.


In GIMP, every color channel, including the alpha channel, has a range of possible values from 0 to 255; in computing terminology, a depth of 8 bits. Some digital cameras can produce image files with a depth of 16 bits per color channel. GIMP cannot load such a file without losing resolution. In most cases the effects are too subtle to be detected by the human eye, but in some cases, mainly where there are large areas with slowly varying color gradients, the difference may be perceptible.

Figureˆà5.3.ˆà Example of an image with alpha channel

Example of an image with alpha channel

Red channel

Example of an image with alpha channel

Green channel

Example of an image with alpha channel

Blue channel

Example of an image with alpha channel

The Alpha channel shows the image area which is transparent.

Example of an image with alpha channel

A color image in RGB mode with an Alpha channel.

Un'immagine in modalit†à RGB con un canale alfa.


The third type, indexed images, is a bit more complicated to understand. In an indexed image, only a limited set of discrete colors are used, usually 256 or less. These colors form the òÀÜcolormapòÀÝ of the image, and each point in the image is assigned a color from the colormap. Indexed images have the advantage that they can be represented inside a computer in a way which consumes relatively little memory, and back in the dark ages (say, ten years ago), they were very commonly used. As time goes on, they are used less and less, but they are still important enough to be worth supporting in GIMP. (Also, there are a few important kinds of image manipulation that are easier to implement with indexed images than with continuous-color RGB images.)

Some very commonly used types of files (including GIF and PNG) produce indexed images when they are opened in GIMP. Many of GIMP's tools don't work very well on indexed imagesòÀÓand many filters don't work at allòÀÓbecause of the limited number of colors available. Because of this, it is usually best to convert an image to RGB mode before working on it. If necessary, you can convert it back to indexed mode when you are ready to save it

GIMP makes it easy to convert from one image type to another, using the Mode command in the Image menu. Some types of conversions, of course (RGB to grayscale or indexed, for example) lose information that cannot be regained by converting back in the other direction.

[Note] Note

If you are trying to use a filter on an image, and it appears grayed out in the menu, usually the cause is that the image (or, more specifically, the layer) you are working on is the wrong type. Many filters can't be used on indexed images. Some can be used only on RGB images, or only on grayscale images. Some also require the presence or absence of an alpha channel. Usually the fix is to convert the image to a different type, most commonly RGB.