Chapter One: Introduction To Computer Graphics
Chapter One: Introduction To Computer Graphics
Computer graphics refers to the creation, storage and manipulation of pictures and drawings
using a digital computer
Graphics Applications
1
Graphics objects can be combined with a live action.
5. EDUCATION AND TRAINING
Computer-generated models of physical, financial and economic systems are often
used as educational aids.
For some training applications, special systems are designed.
Eg. Training of ship captains, aircraft pilots etc.,
Some simulators have no video screens, but most simulators provide graphics screen
for visual operation. Some of them provide only the control panel.
6. VISUALIZATION
The numerical and scientific data are converted to a visual form for analysis and to
study the behavior called visualization.
Producing graphical representation for scientific data sets are called scientific
visualization.
And business visualization is used to represent the data sets related to commerce and
industry.
The visualization can be either 2D or 3D.
7. IMAGE PROCESSING
Computer graphics is used to create a picture.
Image processing applies techniques to modify or interpret existing pictures.
To apply image processing methods, the image must be digitized first.
Medical applications also make extensive use of image processing techniques for
picture enhancements, simulations of operations, etc.
8. GRAPHICAL USER INTERFACE
Nowadays software packages provide graphics user interface (GUI) for the user to
work easily.
A major component in GUI is a window.
Multiple windows can be opened at a time.
To activate any one of the window, the user needs just to check on that window.
Menus and icons are used for fast selection of processing operations.
Icons are used as shortcut to perform functions. The advantages of icons are which
takes less screen space.
And some other interfaces like text box, buttons, and list are also used.
2
Some of the common types of display systems available in the market are:
o Raster Scan Displays
o Random Scan Displays
o Direct View Storage Tube
o Flat Panel Displays
o 3D Viewing Devices
o Stereoscopic and Virtual Reality System
Displays are often referred to as Video Monitor or Video Display Unit (VDU)
The most common monitor that comes with PC is the Raster Scan type
Every display system has three basic parts:
o Display adapter that creates and holds video information,
o Monitor which displays that information, and
o Cable that carries image data between display adapter and monitor
Pixel
o Pixel (also known as picture element) is the smallest size object or color spot that
can be displayed and addressed on a monitor
o Image displayed on the monitor is made up of thousands of pixels
o Each pixel has particular color and brightness value
o The finer the pixels the more number of pixels displayable on a monitor- screen
Resolution
o The maximum number of points that can be displayed without overlap on a screen
is referred to as resolution
o Image resolution refers to the pixel spacing, i.e., the distance from one pixel to
the next pixel
o A typical PC monitor displays screen images with a resolution somewhere
between 25 pixels per inch and 80 pixels per inch (ppi)
o A full screen image with resolution 800 × 600 means that there are 800 columns
of pixels, each column comprising 600 pixels, i.e., a total of 800 × 600 = 480000
pixels in the image area
Aspect Ratio
o The aspect ratio of an image is the ratio of the number of X pixels to the number of Y
pixels
o The standard aspect ratio for PCs is 4:3 and some resolutions even use a ratio of 5:4
o Image displayed using 5:4 aspect ratio will cause the image to appear somewhat
distorted
o The table below (Table 1.1) shows common resolutions, respective number of pixels
and standard aspect ratios
Table 1.1 Common resolutions, respective number of pixels and standard aspect ratios
3
Resolution Number of Aspect
Pixels Ratio
320 × 200 64,000 8:5
640 × 480 307,200 4:3
800 × 600 480,000 4:3
1024 × 768 786,432 4:3
1280 × 1,310,720 5:4
1024
1600 × 1,920,000 4:3
1200
Cathode-Ray Tube
4
Intensity of the electron beam is controlled by setting voltage levels on the control
grid.
A high negative voltage shut off the beam, and a smaller negative voltage simply
decreases the number of electrons in the beam.
The focusing system is needed to force the electron beam to converge into a small
spot as it strikes the phosphor.
Focusing is accomplished with either electric or magnetic field.
Additional focusing hardware is used in high precision systems to keep the beam in
focus at all screen positions.
A phosphor with low persistence is useful for animation; a high-persistence phosphor
is useful for displaying computer pictures. (Persistence means, how long the phosphor
can continuously emit the light.)
The maximum number of points that can be displayed without overlap on a CRT is
referred as the resolution.
Or the resolution is referred as the number of points per centimeter that can be plotted
horizontally and vertically. Eg. 1280 × 1024
Aspect ratio: Ratio of vertical points to horizontal points necessary to produce equal-
length lines in both directions on the screen.
Figure 1.1 the following figure illustrates the basic operation of a raster scan CRT.
In monochrome CRT there is only one electron gun, whereas in a color CRT there
are three electron guns each controlling the display of red, green and blue light,
respectively
A CRT monitor displays color pictures by using a combination of phosphors that emit
different colored light. Two basic methods are used for producing color displays (i)
Beam penetration and (ii) shadow-mask method.
Beam-Penetration Method
Two layers of phosphor, usually red and green are coated onto the screen.
A beam of slow electrons excites only the outer red layer, fast electrons penetrates
through inner red layer and excites the inner green layer. The electrons with intermediate
speed produce the combinations of red and green color.
The speed of electrons is controlled by the beam-acceleration voltage. But the quality of
the pictures is not good here.
Shadow-Mask Method
It can produce a much wider range of color than the beam-penetration method. A
shadow-mask CRT has three phosphor color dots at each pixel position with red,
green and blue.
The color CRT has three color-phosphor dots (dot triad) – red, green and blue – at
each point on the screen surface
This type of CRT has three electron guns, one for each color.
The three electron beams are deflected and focused as a group onto the shadow mask, which
contains corresponding holes for each pixel position.
The color variation is obtained by varying the intensity levels of the three electron beams. For
example, turning off the green and red beam, we will get only blue color.
A shadow mask – a fine metal sheet with a regular array of holes punched in it – is
aligned in a way that the set of three beams sweeps across the shadow mask
converges and intersects at the holes and then hits the correct phosphor dot as shown
in Figure 1.2
6
Figure 1.2 Electron beams passing Shadow Mask
o To produce picture on screen, these electron beams start at the top of the screen and
scan rapidly from left to right along the rows of electron dots
o They return to the leftmost position one line down and scan again and repeat this to
cover the entire screen
Horizontal retrace
o The return of the beam direction to the leftmost position one line down is called
horizontal retrace during which electron flow is shut off
Vertical retrace refers to the movement from bottom to top
o An image in raster scan display is basically composed of a set of dots and lines; lines
are displayed by making these dots bright (with desired color) which lie as close as
possible to the shortest path between the end points of the line
Refresh Rate and Interlacing
A phosphor material glows for a fraction of second when hit by electron beams and
then fades making the image unstable (results in a flicker in the image)
To make the screen stable, the image must be redrawn a number of times in a second
This process is known as refreshing and it is depicted on Figure 1.3
After scanning all pixels, the electron beam reaches the rightmost position in the
bottommost pixel line. The electron flow is switched off and the vertical deflection
mechanism steers the beam to the top left position to start another cycle of scanning
This diagonal deflection is known as vertical retrace
In order to avoid flicker, the image should be redrawn quickly in such a way that our
eyes cannot tell what is going on
The number of times per second that the screen is refreshed is known as the refresh
rate, and is measured in Hertz (Hz), the unit of frequency
Common refresh rates are: 56, 60, 65, 70, 72, 75, 80, 85, 90, 95, 100, 110 and 120 Hz
The maximum refresh rate possible depends on the resolution of the image
7
A higher resolution screen supports less refresh rate than that of lower resolution
image due to the more number of pixels to cover with each sweep
8
For a mono monitor, a pixel can be black (zero intensity) or white (maximum
intensity) or have different shades of gray
Color Depth or Bit Depth
The number of memory bits required to store color information (intensity values for
all three primary components) about a pixel is called color depth or bit depth
A minimum of one memory bit (color depth = 1) is required to intensity value either 0
or 1 for every screen pixel
The block of memory which stores (or is mapped with) bilevel intensity values for
each pixel of a full screen of a full black and white image is called a bit plane or
bitmap
Color or gray levels can be achieved using additional bit planes
n bits per pixel (color depth = n) – a collection of n-bit planes – allows specifying 2 n
color or gray shades at each pixel
The more the number of bits per pixel used, the finer the color detail of the image
However, increased color depth requires more memory for storage, and more data for
the video card to process, which reduces the allowable refresh rate
Table 1.2 shows common color depths used in PCs
Table 1.2 Common color depths used in PCs
9
The intensity values stored in the palette are not constrained within the ranges zero to
three for blue, zero to seven each green and red
Rather each color is defined using three-byte color definition that is used in true color
Upon reading the bit plane, the resulting number instead of directly specifying the
pixel color, is used as a pointer to three-byte color value entry in the lookup table
For example, if the color number read from the bit plane is 10 for a given pixel, then
the intensities of red, green and blue to be displayed for that pixel is found at the 10th
entry of the table
So the full range of true color can be accessed, but 256 of the available more than 16
million colors can be used at a time
The palette is an excellent compromise at the cost of moderate increase in memory: it
allows only eight bits of frame buffer to be used to specify each color in an image and
allows the creator of an image to decide what the 256 colors in the image should be
Frame Buffer and Output Circuitry
Frame Buffer
A screen of monochrome text needs only 2 KB of memory space in the early days of
PCs
Special parts of the upper memory area (UMA) were dedicated to hold this video data
As the need for video memory increased into the megabyte range, it made more sense
to put the memory on the video card itself
Frame buffer is the video memory (RAM) that is used to hold or map the image
displayed on the screen. It is a memory area which contains an internal representation
of an image.
o It can be implemented as part of the main memory
o Or as separate memory
The amount of memory depends primarily on the resolution of the screen image and
also the color depth used per pixel, i.e.,
Memory in MB = (X-resolution × Y-resolution × bits-per-pixel) / (8 × 1024 × 1024)
Practically you need more memory than this formula compute. This is because of:
video cards are available in the market in certain memory configurations (in terms
of whole megabytes), for example, you can’t order 1.7 MB but you have to use a
2 MB card available in the market, and
many video cards, especially high end accelerators and 3D cards, use memory for
computation as well as for the frame buffer
Table 1.3 shows the amount of memory required in megabytes required for the frame
buffer for each common combination of screen resolution and color depth. The
smallest industry standard video memory configuration required to support the
combination is shown in parentheses
Table 1.3 Video Memory Configurations
10
320 × 200 0.03 (256 0.06 (256 0.12 (256 0.18 (256
KB) KB) KB) KB)
640 × 480 0.15 (256 0.29 (512 0.59 (1 MB) 0.88 (1 MB) 1.17 (2 MB)
KB) KB)
800 × 600 - 0.46 (512 0.92 (1 MB) 1.37 (2 MB) 1.83 (2 MB)
KB)
1024 × 768 - 0.75 (1MB) 1.50 (2 MB) 2.25 (4 MB) 3.00 (4 MB)
1280 × - 1.25 (2 MB)2.50 (4 MB) 3.75 (4 MB) 5.00 (6 MB)
1024
1600 × - 1.83 (2 MB) 3.66 (4 MB) 5.49 (6 MB) 7.32 (8 MB)
1200
Some motherboard designs integrate the video chipset into the motherboard itself and
use a part of the system RAM for the frame buffer. This is called unified memory
architecture and it is done for cost saving
The result is almost much lower video performance, because in order to use high
resolutions and refresh rates, the video memory needs to have much higher
performance than the RAM normally used for the system
A technology called Accelerated Graphics Port or AGP is introduced by Intel in
order to meet the increasing demand for faster and dedicated video memory at a
comparable price
AGP allows the video processor access the system memory for graphics calculations,
but keeps dedicated video memory for frame buffer
This is more efficient because the system memory can be shared dynamically
between the system processor and the video processor depending on the needs of the
system
AGP is a port – a dedicated interface between the video chipset and the system
processor
The display adapter circuitry (on video card or motherboard) in a raster graphics
system typically employs a special purpose processor called Display Processor or
Graphics Controller or Display Coprocessor which is connected as I/O peripheral
to the CPU
Such processor assist the CPU in scan converting1 the output primitives (line, circle,
arc, etc.) into bitmaps in frame buffer and also perform raster operations of moving,
copying and modifying pixels or blocks of pixels
A major task of the display processor is digitizing a picture definition given in an
application program into a set of pixel-intensity values for storage in the frame buffer.
This digitization process is called scan conversion
The output circuitry also includes another specialized hardware called Video
Controller which actually drives the CRT and produces the display on the screen
1
Scan conversion means digitizing a picture definition created by some graphics application program, i.e., loading
the frame buffer locations with binary equivalents of pixel intensity values calculated by the application programs
11
Figure 1.4 shows the general architecture of a raster display system
Graphics Application Software
Picture Definition
Scan
Conversion
Display
CPU Frame Buffer
Processor
Pixel Color or
Intensity Value
Display
System Video
Processor Monitor
Memory Controller
Memory
Analog Signal
Type of CRTs
There are two types of CRTs basically: raster scan type and random scan type
The main difference between the two is the technique with which the image is generated
on the screen
Raster Scan Display
o A Raster Scan CRT works much like a Television set.
o Light occurs when an electron beam stimulates a phosphor
o In Raster Scan display, images are created as grid of pixels. Picture definition is
stored in a frame buffer memory or refresh buffer.
o In Raster scan, the electron beam from electron gun is swept horizontally across the
phosphor.
o In raster scan method, the entire screen is drawn at a time
o After the bottom line is swept, the beam returns to the top and sweep process begins
again.
Example: Assume a display of 16 X 16 pixels, each of which is either ON or OF.
o The electron beam traces a path across the first row, then return to starting side and
moves across the second row, and so on.
12
o The beam is turned on or off as it passes over a pixel that should be on or off. In the figure, the
beam is off for the entire first row, off during the retrace and on for the two pixels that are on
Black and white systems (Bilevel) systems: Bit value 0 -> Beam turned on
Bit value 1 ->Beam turned off
Random Scan Display
o In random scan technique, the electron beam is directed to the particular points of the
screen where the image is produced
o Draw a picture one line at a time
o Each image is expressed in the form of a series of {move-to, draw-to} commands
o The beam could be moved to a specific x,y location while turned off and then turned
on and draw-to command would move the beam (while on) to a second x,y location
– the result is a line drawn from the first location to the second.
o Here, the CRT has the electron beam directed only to the parts of the screen where a
picture is to be drawn. Random-scan monitors draw a picture one line at a time, called
as vector display.
o Refresh rates on a ransom-scan system depends on the number of lines to be
displayed.
o Picture definition is stored as a set of line-drawing commands in the refresh display
file or refresh buffer.
o To display a specified picture, the system cycles through the set of commands in the
display file, drawing each component line.
o These systems are designed for the line-drawing applications and can’t display
realistic shaded scenes.
o It generates the image by drawing a set of random straight lines much in the same
way one might move a pencil over a piece of paper to draw an image
13
o This method is also referred to as vector drawing or stroke writing or calligraphic
display
o There are no bit planes containing mapped pixel. Instead the display buffer memory
stores a set of line drawing commands along with the end point coordinates in a
display list or display program created by a graphics application
o The display processing unit (DPU) executes each command during refresh cycle and
feeds the vector generator with digital x, y and Δx, Δy values
o The vector generator converts the digital signals into equivalent analog deflection
voltages
o This causes the electron beam to move to the start point or from the start point to the
end point of a line vector
o Thus, the beam sweep does not follow any fixed pattern
o Though the vector-drawn images lack in depth and real – like color precision, the
random displays can work at higher resolutions than the raster displays. The images
are sharp and have smooth edges unlike the jagged edges and lines on raster displays
Example:
Move to (a,b)
Draw to (c,d)
Draw to (e,f)
Draw to (g,h)
Draw to (a,b)
Refresh display file contains the line drawing commands
It is for Line drawing applications
Advantages of Random scan
o Very high resolution, limited only by monitor.
o Easy animation, just dray at different positions.
o Requires little memory
14
o Two electron guns are used, the primary gun is used to store the picture pattern, the second,
the floor gun, maintains the picture display.
o In DVST there is no refresh buffer; the images are created by drawing vectors or line
segments with a relatively slow-moving electron beam
o The beam is designed not to draw directly on the phosphor dot but on a fine wire
mesh (called storage mesh) coated with dielectric and mounted just behind the screen
o A pattern of positive charge is deposited on the grid, and this pattern is transferred to
the phosphor coated screen by a continuous flood of electrons emanating from a
separate flood gun
o Just behind the storage mesh is a second grid, the collector, whose main purpose is to
smooth out the flood of electrons. These electrons pass through the collector at low
velocity and are attracted to the positively charged portions of the storage mesh but
repelled by the rest
o Electrons not repelled by the storage mesh pass right through it and strike the
phosphor
o The storage tube retains the image generated until it is erased. Thus, no refreshing is
necessary, and the image is absolutely flicker free
o A major disadvantage of DVST in interactive graphics is its inability to selectively
erase parts of an image from the screen. The entire image should be redrawn
o However, the DVST supports a very high resolution which is good for display
complex images
Advantage:
o Because of no refreshing is needed very complex pictures can be displayed at very high
resolutions without flicker.
Disadvantage:
o It refers to a class or video devices that have reduced volume, weight and power
requirements composed to CRT.
o To satisfy the need for a compact portable monitor, modern technology has gifted us
LCD panel, plasma panel, LED (Light Emitting Diode) panel and thin CRT
o A main advantage of flat-panel displays is that they are thinner than CRTs and we can
hang them on walls or wear on our wrists.
15
o The two categories of flat-panel displays are :
Emissive displays: the device which convert electrical energy into light. (Plasma
panel)
Non-Emissive displays: used optical effects to convert sunlight or light from some
other source into graphic patterns. (LCD)
o These devices are smaller, lighter and specifically thinner than the conventional CRT and
thus termed as Flat Panel Display (FPD)
o FPDs in general and LCD panels in particular are most suitable for laptop computers but are
expensive to produce
o Thin CRT is produced by bending the tube of normal CRT in the middle
LCD
o Commonly used in small systems, such as calculators, and portable, laptop computers.
o These non-emissive devices produce a picture by passing polarized light from the surroundings or
from an internal light source through a liquid-crystal material that can be aligned either block or
transmit the light
o LCD basically consists of a layer of liquid crystal, sandwiched between two polarizing
plates
o The polarizers are aligned perpendicular to each other (one vertical and the other
horizontal), so that the light incident on the first polarizer will be blocked by the second
o LCD displays are addressed in a matrix fashion. Rows of matrix are defined by a thin
layer or horizontal transparent conductors, while columns are defined by another thin
layer of vertical transparent conductors; the layers are placed between the LCD layer and
the respective polarizer plate
o The intersection of the two conductors defines a pixel position
o The liquid crystal material is made up of a long rod-shaped crystalline molecules
o The individual polar molecules in nematic (spiral) LC layer are normally arranged in a
spiral fashion such that the direction of polarization of polarized light passing through it
is rotated 90 degrees
o Light from an internal source enter the first polarizer (say horizontal) and is polarized
accordingly (horizontally). As light passes through the LC layer is twisted 90 degrees (to
align with the vertical) so that it is allowed to pass through the rear polarizer (vertical)
and reflect from the reflector behind the rear polarizer. The reflected light when reaches
the viewers travelling in reverse direction, the LCD appears bright
o In color LCD there are layers of three liquid crystal panels on top of another, each filled
with a colored (red, green or blue) liquid crystal
Figure 1.5 shows LCD
16
Figure 1.5 Liquid Crystal Display
Plasma Panel
o Here a layer of gas (usually Neon) is sandwiched between two glass plates
o Thin vertical (column) strips of conductor run across one plate, while horizontal
(row) conductors run up and down the plate
o By applying high voltage to a pair of horizontal and vertical conductors, a small
section of gas at the intersection of the conductors breaks down into glowing plasma
of electrons and ions
o Thus, in the array of gas bulbs, each one can be set to an ‘on’ (glowing) state or ‘off’
state by adjusting voltages in the approximate pair of conductors
o Once set ‘on’ the bulbs remain in that state until explicitly made ‘off’ by momentarily
reducing the voltage applied to the pair of conductors. Hence no refreshing is
necessary
o Because of its excellent brightness, contrast and scalability to larger sizes, plasma
panel is attractive
17