Graphics Reference
In-Depth Information
k image with the scene you witness as
you look through a window: At every point of the window, you perceive a color
with some amount of lightness. That is to say, we could summarize your percept
as a function from points of the window to real numbers representing lightness
(measured in some way) at the points. The set of all real-valued functions on a
rectangle constitutes an infinite -dimensional vector space. We choose, however,
to represent such images with n
Contrast this description of an n
×
k representative numbers, that is, an element
of a finite -dimensional vector space. There is necessarily some loss in the conver-
sion from the former to the latter. The exact nature of this loss depends on how
the finite image was created; we'll see that the choices made during image for-
mation (whether via a camera or via a software renderer) can have far-reaching
impact.
×
17.3 Image File Formats
Images are stored in many formats; typically the storage format bears a close
resemblance to the display format. That is, an n
k imagemaybestoredas nk
triples of RGB values, with each R value representing the red part of a pixel,
stored in a sequence of some fixed number of bits, and similarly for G and B.
But some formats have more complex representations. For example, we might,
considering the red values only, reading across a row of an image, store the value
of the first pixel, and the difference of the second from the first, and then the
difference of the third from the second etc. Because these differences will tend
to be smaller numbers, we might hope to store them with fewer bits. This would
give a losslessly compressed image: one in which the data occupies less space,
but from which the original RGB image can be reconstructed.
On the other hand, sometimes we can use lossy compression —a method of
compressing an image so that some of the original data is lost, but not enough to
matter for the intended use of the image. A simple lossy compression scheme
would be to store only a checkerboard pattern of alternate pixels and then, at
display time, interpolate missing pixel values from the known neighboring val-
ues. This generates a two-to-one savings in storage, but at a cost of substantial
image-quality loss in many cases. More sophisticated compression schemes use
the known statistics of natural images and known information about the human
visual system (e.g., we're sensitive to sharp edges, but less sensitive to slowly
changing colors) to choose which data in the image to keep and omit. JPEG com-
pression, for instance, divides the image into small blocks and compresses the
data stored in each one; it's easy to see the blocks if you zoom in on a displayed
JPEG image.
Some formats also store metadata (information about when the image was
produced, what device or program produced it, etc.) and, in some cases, informa-
tion about the contents, which is typically described in terms of channels. The
red values for all pixels constitute one channel, called a color channel; there are
corresponding blue and green channels. The colors stored in one color channel
may be represented by small integers with some number of bits, so we speak of an
“8-bit red channel” or a “6-bit blue channel.” The image metadata gives informa-
tion like the “bit depth” of each color channel. If the image also contains a depth
value at each pixel, we speak of a “depth channel”; the metadata describes such
noncolor channels as well.
×
 
 
 
Search WWH ::




Custom Search