Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
литература / Digital_Video_and_HD_Second_Edition_Algorithms_and_Interfaces.pdf
Скачиваний:
0
Добавлен:
13.05.2026
Размер:
38.02 Mб
Скачать

Symbolic

Plain ASCII

 

 

 

 

 

WMF

 

 

 

 

 

 

 

 

Volume data

 

 

 

Image

text

 

 

 

 

 

PICT

 

 

 

 

 

 

 

 

Geometric

 

 

Description

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PostScript/

 

 

 

 

 

 

 

 

data

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PDF

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Grayscale

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

typ. 8-bit

 

 

 

 

 

 

 

 

 

 

Raster

 

 

 

 

 

 

 

 

 

 

 

 

 

 

LUT

 

 

 

 

Truecolour

 

Bilevel

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

typ. 24-bit

 

1-bit

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Data

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

LUT

 

 

 

 

 

 

 

 

Pseudocolour

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

typ. 8-bit

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CLUT

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Subband

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Compressed

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

JPEG

VQ

 

 

 

 

 

ITU-Tfax

 

 

 

RLE

 

 

 

LZW

 

 

 

 

 

 

 

 

 

 

BTC

 

 

 

 

Image Data

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

etc.

(Examples)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure 6.1 Raster image data may be captured directly, or may be rendered from symbolic image data. Traversal from left to right corresponds to conversions that can be accomplished without loss. Some raster image formats are associated with a lookup table (LUT) or colour lookup table (CLUT).

Murray, James D., and William vanRyper (1996), Encyclopedia of Graphics File Formats, Second Edition (Sebastopol, Calif.: O’Reilly & Associates).

and some systems use other techniques. For a system to operate in a perceptually uniform manner, similar to or compatible with video, its LUTs need to be loaded with suitable transfer functions. If the LUTs are loaded with transfer functions that cause code values to be proportional to intensity, then the advantages of perceptual uniformity will be diminished or lost.

Many different file formats are in use for each of these representations. Discussion of file formats is outside the scope of this book. To convey photo- graphic-quality colour images, a file format must accommodate at least 24 bits per pixel. To make maximum perceptual use of a limited number of bits per component, nonlinear coding should be used, as I outlined in Perceptual uniformity, on page 30.

Symbolic image description

Many methods are used to describe the content of a picture at a level of abstraction higher than directly enumerating the value of each pixel. Symbolic image data is converted to a raster image by the process of

rasterizing. Images are rasterized (or imaged or rendered)

66

DIGITAL VIDEO AND HD ALGORITHMS AND INTERFACES

by interpreting symbolic data and producing raster image data. In Figure 6.1, this operation passes information from the top row to the middle row.

Geometric data describes the position, size, orientation, and other attributes of objects; 3-D geometric data may be interpreted to produce an image from

a particular viewpoint. Rasterizing from geometric data is called rendering; truecolour images are usually produced.

Adobe’s PostScript system is widely used to represent 2-D illustrations, typographic elements, and publications. PostScript is essentially a programming language specialized for imaging operations. When

a PostScript file is executed by a PostScript interpreter, the image is rendered. (In PostScript, the rasterizing operation is often called raster image processing, or RIPping.) An encapsulated PostScript file (EPS or EPSF) is a special case of a PostScript file that describes one image; Adobe’s PDF format is essentially a nonprogrammable variant of PostScript.

Once rasterized, there is no general method of converting raster image data back into a symbolic description: A raster image – in the middle row of Figure 6.1 – generally cannot be returned to its description in the top row. If your application involves rendered images, you may find it useful to retain the symbolic data even after rendering, in case the need arises to rerender the image, at a different size, perhaps, or to perform a modification such as removing an object.

Images from a fax machine, a video camera, or

a greyscale or colour scanner originate in raster image form: No symbolic description is available. Optical character recognition (OCR) and raster-to-vector techniques make brave but generally unsatisfying attempts to extract text or geometric data from raster images.

Raster images

There are four distinct types of raster image data:

Bilevel, by definition 1 bit per pixel;

Greyscale, typically 8 bits per pixel;

Pseudocolour, typically 8 bits per pixel; and

Truecolour, typically 24 bits per pixel.

CHAPTER 6

RASTER IMAGES IN COMPUTING

67

Historical hicolour systems assigned 5 bits to each of red, green, and blue, which – with one bit of overhead – formed a 16-bit pixel. (Some systems assigned 6 bits to green and had no overhead bit.) The hicolour scheme is obsolete.

Bilevel

Greyscale

Truecolour

Greyscale and truecolour systems are capable of representing continuous tone. Video systems use only truecolour (and perhaps greyscale as a special case).

In the following sections, I will explain bilevel, greyscale, truecolour, and pseudocolour in turn. The truecolour and pseudocolour descriptions are accompanied by block diagrams that represent the hardware at the back end of the framebuffer or graphics card. (Historically, this hardware would have included digital-to-analog converters, DACs; today, digital display interfaces such as DVI, HDMI, and DisplayPort are used.) Alternatively, you can consider each block diagram to represent an algorithm that converts image data to display R’, G’, and B’ components.

Each pixel of a bilevel (or two-level) image comprises one bit, which represents either black or white – but nothing in between. In computing this is often called monochrome. (That term ought to denote shades of

a single hue; however, in common usage – and particularly in video – monochrome denotes the black-and- white, or greyscale, component of an image.)

Since the invention of data communications, binary zero (0) has been known as space, and binary one (1) has been known as mark. A “mark” on an electronic display device emits light, so in video and in computer graphics a binary one (or the maximum code value) conventionally represents white. In printing, a “mark” deposits ink on the page, so in printing a binary one (or in greyscale, the maximum pixel value) conventionally represents black.

A greyscale image represents an effectively continuous range of tones, from black, through intermediate shades of grey, to white. A greyscale system with a sufficient number of bits per component, 8 bits or more, can represent a black-and-white photograph.

A greyscale system may or may not have a lookup table (LUT); it may or may not be perceptually uniform.

In printing, a greyscale image is said to have continuous tone, or contone (distinguished from line art or type). When a contone image is printed, halftoning is ordinarily used.

A truecolour system has separate red, green, and blue components for each pixel. In most truecolour systems, each component is represented by a byte of 8

68

DIGITAL VIDEO AND HD ALGORITHMS AND INTERFACES

CLUTs are necessary for pseudocolour. Most truecolour systems have LUTs as by-products of their capability to handle pseudocolour.

Figure 6.2 Truecolour (24-bit) graphics usually involves three programmable lookup tables (LUTs). The numerical values shown here are from the default Macintosh LUT (prior to Mac OS X 10.6). In video, R’G’B’ values are transmitted to the display with no intervening lookup table. To make a truecolour computer system display video properly, the LUTs must be loaded with ramps that map input to output unchanged. Such

a “unity” mapping (or “ramp”) is the default in PCs.

bits (known as 8 bits per channel, or bpc). Each pixel has three components (channels), so this mode is often called “24-bit colour” (or “millions of colours”). The RGB values of each pixel can represent 224, or about 16.7 million, distinct codes. In computing, a truecolour framebuffer usually has three lookup tables (LUTs), one for each component. The LUTs and DACs of a 24-bit truecolour system are sketched in Figure 6.2 below.

The mapping from image code value to display voltage is determined by the content of the LUTs. Owing to the perceptually uniform nature of the display, the best perceptual use is generally made of truecolour pixel values when each LUT contains an identity function (“ramp”) that maps input to output, unchanged.

In computing, the LUTs can be set to implement an arbitrary mapping from code value to tristimulus value (and so, to intensity). The total number of pixel values that represent distinguishable colours depends upon the transfer function used. If the LUT implements

a power function to impose gamma correction on linear-light data, then the code-100 problem will be at its worst. With 24-bit colour and a properly chosen transfer function, photographic quality images can be displayed and geometric objects can be rendered smoothly shaded with sufficiently high quality for many applications. But if the LUTs are set for linear-light representation with 8 bits per component, contouring

24 bits

R’

8

8

G’

8

B’

 

0

 

16

37

255

 

D

A

0

0

44

71

 

239

255

255

D

A

LUT

243

D

A

R’

G’

B’

CHAPTER 6

RASTER IMAGES IN COMPUTING

69

Poynton, Charles (1998), “The rehabilitation of gamma,” in Proc. SPIE 3299 (Human Vision and Electronic Imaging III, Bellingham, Wash.: SPIE).

Concerning alpha, see page 387.

Pseudocolour

I reserve the term CLUT for pseudocolour. In greyscale and truecolour systems, the LUTs store transfer functions, not colours. In Macintosh, pseudocolour CLUT values are roughly, but not optimally, perceptually coded.

will be evident in many images, as I mentioned on page 30. Having 24-bit truecolour is not a guarantee of good image quality. If a scanner claims to have 30 bits (or 36 bits) per pixel, obviously each component has 10 bits (or 12 bits). However, it makes a great deal of difference whether these values are coded physically (as linearlight luminance, loosely “intensity”), or coded perceptually (as a quantity comparable to lightness).

In video, either the LUTs are absent, or each is set to the identity function. Studio video systems are effectively permanently wired in truecolour mode with perceptually uniform coding: Code values are presented directly to the DACs, without intervening lookup tables.

It is easiest to design a framebuffer memory system where each pixel has a number of bytes that is a power of two; so, a truecolour framebuffer often has four bytes per pixel – “32-bit colour.” Three bytes comprise the red, green, and blue colour components; the fourth byte is used for purposes other than representing colour. The fourth byte may contain overlay information, or it may store an alpha (α) or key component representing opacity from black (0, fully transparent) to white (1, fully opaque). In computer graphics, the alpha component modulates components (usually RGB) that are coded in the linear-light domain. In video, the linear key signal modulates nonlinear (gamma-corrected) R’G’B’ signals or luma and colour difference components such as Y’CBCR.

In a pseudocolour (or indexed colour, or colourmapped) system, several bits – usually 8 – comprise each pixel in an image or framebuffer. This provides

a moderate number of unique codes – usually 256 – for each pixel. Pseudocolour involves “painting by numbers,” where the number of colours is rather small. In an 8-bit pseudocolour system, any particular image, or the content of the framebuffer at any instant in time, is limited to a selection of just 28 (or 256) colours from the universe of available colours.

Each code value is used as an index into a colour lookup table (CLUT, colourmap, or palette) that retrieves

R’G’B’ components; the DAC translates these linearly into voltage levels that are applied to the display. (Macintosh is an exception: Image data read from the

70

DIGITAL VIDEO AND HD ALGORITHMS AND INTERFACES

Figure 6.3 Pseudocolour (8-bit) graphics systems use a limited number of integers, usually 0 through 255, to represent colours. Each pixel value is processed through a colour lookup table (CLUT) to obtain red, green, and blue output values to be delivered to the display.

8 bits (code 0…255)

 

 

 

0

 

 

 

 

 

 

 

 

42

37

71

243

CLUT

 

 

 

 

 

 

 

255

 

 

 

 

D

D

D

A

A

A

R’

G’

B’

The browser-safe palette forms a radix-6 number system with RGB digits valued 0 through 5.

216 = 63

CLUT is in effect passed through a second LUT.) Pseudocolour CLUT values are effectively perceptually coded.

The CLUT and DACs of an 8-bit pseudocolour system are sketched in Figure 6.3 above. A typical lookup table retrieves 8-bit values for each of red, green, and blue, so each of the 256 different colours can be chosen from a universe of 224, or 16777216, colours. (A CLUT may return 4, 6, or more than 8 bits for each component.) Pseudocolour image data is always accompanied by the associated colourmap (or palette). The colourmap may be fixed, independent of the image, or it may be specific to the particular image (adaptive or optimized). A popular choice for a fixed CLUT is the browser safe palette comprising the 216 colours formed by combinations of 8-bit R’, G’, and B’ values chosen from the set {0, 51, 102, 153, 204, 255}. This set of 216 colours fits nicely within an 8-bit pseudocolour CLUT; the colours are perceptually distributed throughout the R’G’B’ cube. Pseudocolour is appropriate for images such as maps, schematic diagrams, or cartoons, where each colour or combination is either completely present or completely

absent at any point in the image. In a typical CLUT, adjacent pseudocolour codes are generally completely unrelated; for example, the colour assigned to code 42 has no necessary relationship to the colour assigned to code 43.

CHAPTER 6

RASTER IMAGES IN COMPUTING

71

Соседние файлы в папке литература