Chapter - 1
Chapter - 1
Chapter - 1
INTRODUCTION
TO
COMPUTER GRAPHICS
The term computer graphics refers to "almost everything on computers that is
not text or sound”
Computer graphics is an art of drawing pictures on computer screens with the
help of programming.
In other words, we can say that computer graphics is a rendering tool for the
generation and manipulation of images.
Refers to creation, Storage and manipulation of pictures/data and drawing
using a digital computer.
Effective tool for presenting information.
Computer aided design.
Computer aided manufacturing.
Creation, Manipulation, and Storage of geometric objects (modelling) and
their images (rendering).
Display those images on screens or hardcopy devices
Image processing
Others: GUI, Haptics, Displays (VR) etc
A TYPICAL GRAPHICS
SYSTEM
A Typical graphics system consists of
Processor
Memory
Frame Buffer
Output Devices
Input Devices
4
A TYPICAL GRAPHICS
SYSTEM
5
Scanning Display In Graphics
The primary output device in a graphical system is the video
monitor.
The main element of a video monitor is the Cathode Ray Tube
(CRT), shown in the following illustration. The operation of CRT
is very simple:
1) The electron gun emits a beam of electrons (cathode rays).
2) The electron beam passes through focusing and deflection
systems that direct it towards specified positions on the
phosphor-coated screen.
3) When the beam hits the screen, the phosphor emits a small
spot of light at each position contacted by the electron beam.
4) It redraws the picture by directing the electron beam back
over the same screen points quickly.
6
Scanning Display In Graphics
7
Cont’d ….
There are two ways (Random scan and Raster scan) by which we
can display an object on the screen.
Raster Scan : One of the important achievements in graphics is
the development of raster graphics in early seventies
In a raster scan system, the electron beam is swept across the
screen, one row at a time from top to bottom.
As the electron beam moves across each row, the beam intensity is
turned on and off to create a pattern of illuminated spots.
8
Cont’d ….
Picture definition is stored in memory area called the Refresh
Buffer or Frame Buffer. This memory area holds the set of
intensity values for all the screen points.
Stored intensity values are then retrieved from the refresh buffer
and “painted” on the screen one row (scan line) at a time as shown
in the following illustration.
9
Cont’d ….
Each screen point is referred to as a pixel (picture element) or pel.
At the end of each scan line, the electron beam returns to the left
side of the screen to begin displaying the next scan line.
10
Cont’d ….
Random Scan(Vector Scan): were developed in mid-sixties
and were in common use until mid-eighties.
In this technique, the electron beam is directed only to the part of
the screen where the picture is to be drawn rather than scanning from
left to right and top to bottom as in raster scan.
It is also called vector display, stroke-writing display, or
calligraphic display.
Picture definition is stored as a set of line-drawing commands in an
area of memory referred to as the refresh display file.
To display a specified picture, the system cycles through the set of
commands in the display file, drawing each component line in turn.
After all the line-drawing commands are processed, the system
cycles back to the first line command in the list.
11
Cont’d ….
Random-scan displays are designed to draw all the component
lines of a picture 30 to 60 times each second.
12
Cont’d ….
◦ In these devices , everything is displayed as a combination of
lines (even characters)
◦ Typically it consists of display processor connected as an I/O
peripheral to CPU, a display buffer memory and a CRT.
◦ The buffer stores the computer-produced display list or display
program; it contains point, line character plotting commands
(opcodes)
13
Display Technology: LCD
Liquid Crystal Displays (LCDs)
◦ Liquid crystal – these compounds have a crystalline
arrangement of molecules, yet they flow like a liquid
◦ LCSs are commonly used in small systems such as
laptops, calculators
◦ LCDs: organic molecules, naturally in crystalline state,
that liquify when excited by heat or E field
◦ Crystalline state twists polarized light 90º
14
LCD..
Produces a picture by passing polarized light from the
surroundings or from an internal light source through a liquid-
crystal material that can either block or transmit the light.
The intersection of the two conductors defines a pixel
position.
Polarized light is twisted as it passes through the opposite
polarizer. The light is then reflected back to the viewer.
To turn off the pixel, voltage is applied to the two intersecting
conductors to align the molecules so that the light is not
twisted.
15
16
Color
Color is achieved by having three electron guns mixing the
colors red, green and blue (RGB).
White is perceived when all are illuminated and when all
are off its black.
Typically each color is specified by an 8-bit value . Thus
8*3=24 bits are needed to represent a color pixel(also called
true color).
17
Color (cont.)
Storing say 24 bits of information for each pixel of a (say),
1000*1000 screen eats up 3 Megabytes of memory. Thus low end
graphics workstations use a more economical approach.
They use 8 bits per pixel where each 8-bit entry is an index into a
256-entry color map. Each entry in the color map is a 24-bit
value containing R,G,B components of the color. This is color-
Indexing.
256 entry
8bits
24 bits
18
19
Frame Buffer
A frame buffer is a large contiguous piece of computer memory.
◦ At a minimum, there is one memory bit for each pixel (picture
element) in the raster; this amount of memory is called bit
plane
◦ Memory bit has only two states, therefore a single bit plane
yields a black-and white display.
◦ A 1024 * 1024 element square raster requires
2 20 or 1,048,576 ( 210*210) memory bits in a single bit plane.
◦ Each bit has 2 states (monochrome display).
20
Frame Buffer
◦ Frame buffer is a digital device and the CRT is an analog
device.
◦ Therefore, a conversion from a digital representation to an
analog signal must take place when information is read
from the frame buffer and displayed on the raster CRT
graphics device.
◦ Conversion from digital to analog is done by DAC
(digital-to-analog converter).
◦ Each pixel in the frame buffer must be accessed and
converted before it is visible on the raster CRT.
21
Frame Buffer raster CRT device
1 DAC
Register Electron Gun
22
Color and Gray levels
Color or gray levels are incorporated into a frame buffer by
adding additional bit planes.
The binary value from each of the N bit planes is loaded
into corresponding positions into a register. The resulting
binary number is interpreted as an intensity level between 0
(dark) and 2N-1(full intensity)
A Raster with 3 bit planes generates 8 (23) intensity levels.
In this case, the frame buffer should have 3,145,728 ( 3 *
1024 * 1024) memory bits.
23
An N bit gray level frame buffer
Register
N
N 0
1 0 1 0
2
0 2N DAC
Electron gun
N=3 2N levels
Frame Buffer
CRT Raster
24
Simple color frame buffer(3 bit)
0 0 DAC
3 1
0 1 DAC
0 DAC
25
3 Bit plane frame buffer color
combinations
Red Green Blue
Black 0 0 0
Blue 0 0 1
Green 0 1 0
Cyan 0 1 1
Red 1 0 0
Magenta 1 0 1
Yellow 1 1 0
White 1 1 1
26
A 24 Bit plane color frame buffer
8 registers
Color Guns
01001011 3 bit DAC
Blue 75
0
2N entries
CRT Raster
28
Color frame buffer(24 bit plane) with
lookup tables(10 Bit wide)
W=10
W=10
W bit DAC
W bit DAC
N=8 CRT Raster
W=10 29
Resolution
Resolution
◦ The Maximum number of points that are displayed without
overlap.
◦ This is usually given as the number of horizontal points versus the
number of vertical points. These points are called pixels or picture
elements.
The maximum resolution may be determined by the characteristics of
the monitor for a random scan system or by a combination of monitor
and graphics card memory for a raster scan system.
Typical resolution on high-quality systems is 1280 by 1024, higher
also available.
Physical size of the graphics monitor is measured as length of the
screen diagonal which generally varies from 12 in. to 27in.
30
Aspect Ratio
Aspect Ratio
◦ The aspect ratio is the ratio of horizontal dimension/vertical
dimension.
Example
◦ If the monitor dimensions are 8 inches by 6 inches, the aspect
ratio is 8/6 which is equal 1.33.
◦ If the resolution of the screen is 640 by 480, the length of the
pixel is 640/8 equal to 80 pixels per inch. Similarly height is
480/6 equal to 80 pixels per inch. Thus the pixel is a square.
If the horizontal size of a pixel is not equal to the vertical size,
then it must be corrected for image display else the image will
appear distorted.
31
Image resolutions in practice
WORKSTATIONS
◦ Bitmapped display 960 * 1152* 1b approx 1MB
◦ Color Display 1280* 1024*24b approx 5MB
TELEVISION
◦ NTSC 640*480*8b approx ¼ MB
◦ HDTV 1980*1080*8b approx 2 MB
LASER PRINTERS
◦ 300 dpi (8.5*300)(11*300) approx 1.05 MB
◦ 2400 dpi (8.5*2400)(11*2400) approx 64MB
32
Speed requirements and scanning
rates
Speed requirements for memory access
◦ 1024*768*8 = 768 Kbytes= 786,432 bytes
◦ Read 786*103 bytes in 1600*10-5 secs (inverse of 60) for
60 HZ.
Rough estimation of scanning rates.
◦ Frequency X number of vertical lines (note scan always
means a full horizontal scan)
◦ Example: for an IBM VGA 60*480 = 30 HZ
◦ For 1024 * 768 = 46 Khz
33
Dot size and Addressability
The image quality achievable with display devices depends
on both the addressability and the dot size of the device.
Dot (spot) size is the diameter of the single dot created on
the device.
Addressability is the number of individual dots per inch that
can be created; it may differ in horizontal and vertical
directions.
Addressability in x is the reciprocal of the distance between
the centers of dots at addresses (x,y) and (x+1,y). Similarly
the other direction is calculated.
34
Interdot distance
Interdot distance is the reciprocal of addressability
It is usually desirable that the dot size be somewhat greater
than the interdot distance, so that smooth shapes can be
created.
35
Images
In common usage, an image or picture is an artefact, usually two-
dimensional, that has a similar appearance to some subject -
usually a physical object or a person.
36
IMAGES
Examples..