You are on page 1of 66

Computer Graphics

Computer Graphics involves display, manipulation
and storage of pictures and experimental data for
proper visualization using a computer.
Typical graphics system comprises of a host computer
with support of fast processor, large memory, frame
buffer and
Display devices (color monitors),
Input devices (mouse, keyboard, joystick, touch
screen, trackball)
Output devices (LCD panels, laser printers,
color printers. Plotters etc.)
Interfacing devices such as, video I/O, TV
interface etc.
Applications areas
Typical applications areas are
Plotting in business
Plotting in science and technology
Scientific Visualization
Office automation
Desktop publishing
publishing and advertisements
CAD/CAM design
(VLSI, Construction, Circuits)
Simulation studies Simulators
Cartography Multimedia
(movie, TV Advt., Games etc.)
Virtual reality
Process Monitoring
Digital Image Processing
Education and Training
GUI Graphical User Interface
Typical Components Used:
Dialog Boxes
Scroll Bars
3-D Interface
Various utilities and tools available for
web-based design include: Java, XML,
VRML and GIF animators.
Certain compilers, such as, Visual C/C+
+, Visual Basic, Borland C/C++,
Borland Pascal, Turbo C, Turbo
Pascal, Gnu C/C++, Java provide their
own graphical
Some these
libraries, systemsand
API, support arehelp for
programming 2- (X11,
D/3-D )
device-dependent (Solaris,
Computer Graphics systems could be active or
In both cases, the input to the system is the
scene description and output is a static or
animated scene to be displayed.
In case of active systems, the user controls
display with the help of a GUI, using an input
Computer Graphics is now-a-days, a
component of almost all systems and
applications of computers in every field of
Scan Conversion and Clipping
Drawing of Points, Lines, Markers, Curves,
Circles, Ellipse, Polyline, Polygon. Area filling, fill-
style, fill pattern, clipping algorithms, anti-
aliasing etc.
Curves and Surfaces
Bezier (Bernstein Polynomials) Curves, BSplines,
Cubic-Splines, Quadratic surfaces,
parametric and non-parametric forms, Hermite
Curves etc.
Examples of Computer Graphics
plotters, data matrix, laser printers,
Films, flat panel devices, Video
digitizers, scanners, LCD panels,
keyboard, joystick, mouse, touch
screen, track ball, etc.

The most commonly used

display device is the
CRT Display Devices
(cathoe-ray tube)
A beam of electrons emitted by an electron gun, passes through focusing
and deflection systems the direct the beam towards specified positions
on the phosphor-coated screen.
The phosphor then emits a small spot of light at each position contacted
by the electron beam.
Because the light emitted by the phosphor fades very rapidly, to keep
the phosphor glowing is to redraw the picture repeatedly by quickly
directing the electron beam back over the same points is called refresh
Primary components of electron gun heated metal cathode & control
Intensity of the electron beam is controlled
by setting voltage levels on the control
grid, which is a metal cylinder that fits
over the cathode.
A high negative voltage applied to the
control grid will shut off the beam by
repelling electrons and stopping them
from passing through the small hole at the
end of the control grid structure.
Deflection of the electron beam can be controlled either with electric
fields or with magnetic fields.
Spots of light are produced on the screen by the transfer of
the CRT beam energy to the phosphor.
When the electrons in the beam collide with the phosphor
coating, they are stopped and their kinetic energy is
absorbed by the phosphor.
Part of the beam energy is converted by friction into heat
energy, and the remainder causes electrons in the
phosphor atoms to move up higher quantum-energy levels.
After a short time the excited phosphor electrons begin
dropping back to their stable ground state, giving up their
extra energy as small quantums of light energy.
The combined effect of all the electron light emissions: a
glowing spot that quickly fades after all the excited
phosphor electrons have returned to their ground energy
The frequency of the light emitted by the phosphor is
proportional to the energy difference between the excited
quantum state and the ground state.
CRT related terms
Resolution : The maximum number of
points that can be displayed without overlap on a
CRT is referred to as the resolution.
High resolution systems are often referred to as
high-definition systems.
Aspect Ratio : ratio of vertical points to
horizontal points.
aspect ratio meansa vertical line plotted
with three points has the same length as a horizontal line
plotted with four points.
Cathode-Ray Tubes
Characteristics of Cathode-Ray Tube (CRT)
Intensity is proportional to the number of electrons
repelled in beam per second (brightness)
Resolution is the maximum number of points that
can be displayed without overlap; is expressed as
number of horizontal points by number of vertical
points; points are called pixels (picture elements);
example: resolution 1024 x 768 pixels. Typical
resolution is 1280 x 1024 pixels.
High-definition systems: high resolution systems.
Cathode-Ray Tubes
Focusing forces the electron beam to converge
to a point on the monitor screen
Can be electrostatic (lens) or magnetic (field)
Deflection directs the electron beam horizontally
and/or vertically to any point on the screen
Can be controlled by electric (deflection plates,
slide 11) or magnetic fields (deflection coils, slide
Magnetic coils: two pairs (top/bottom, left/right) of
tube neck
Electric plates: two pairs (horizontal, vertical)
Cathode-Ray Tubes
Aspect ratio
Aspect ratio is the ratio of horizontal
pixels to vertical pixels for an equal
length line.
It is the ratio of the horizontal
dimension over the vertical
Cathode-Ray Tubes


If resolution of 640 x 480 pixels:

Horizontal 640/8 = 80 pixels / inch
Vertical 480/6 = 80 pixels / inch
Square pixels (no distortion).
Raster-scan Displays
Video displays can be either raster-scan
or random-scan displays.
Raster-scan display is the most common
type of monitor using a CRT.
The electron beam scans the screen from
top to bottom one row at a time. Each
row is called a scan line.
The electron beam is turned on and off to
produce a collection of dots painted one
row at a time. These will form the image.
A raster is a matrix of pixels covering
the screen area and is composed of
raster lines.
Raster-scan Displays
The image is stored in a frame buffer
containing the total screen area and where each
memory location corresponds to a pixel.
In a monochrome system, each bit is 1 or 0 for
the corresponding pixel to be on or off (bitmap).
The display processor scans the frame buffer to
turn electron beam on/off depending if the bit is
1 or 0.
For color monitors, the frame buffer also
contains the color of each pixel (color buffer) as
well as other characteristics of the image (gray
scale, ). 8 bits/pixel 0..255 (pixmap).
Examples: television panels, printers, PC
monitors (99% of raster-scan)...
Raster-scan Displays
Refresh rate: 24 is a minimum to avoid flicker,
corresponding to 24 Hz (1 Hz = 1 refresh per second)
Current raster-scan displays have a refresh rate of at
least 60 frames (60 Hz) per second, up to 120 (120
Uses large memory: 640x480 307200 bits 38 kB
Refresh procedure:
Horizontal retrace beam returns to left of screen
Vertical retrace bean returns to top left corner of screen
Interlaced refresh display first even-numbered lines, then
odd-numbered lines
permits to see the image in half the time
useful for slow refresh rates (30 Hz shows as 60 Hz).
Random scan systems are also called vector,
stroke-writing, or calligraphic displays.
The electron beam directly draws the picture
in any specified order.
A pen plotter is an example of such a system.
Picture is stored in a display list, refresh
display file, vector file, or display program as a
set of line drawing commands.
Refreshes by scanning the list 30 to 60 times
per second.
High resolution
Easy animation
Requires little memory
Requires intelligent electron beam (processor
Limited screen density, limited to simple, line-based
Limited color capability.
Improved in the 1960s by the Direct View
Storage Tube (DVST) from Tektronix.
Color CRT Monitor
Uses different phosphors, a combination of Red,
Green, and Blue, to produce any color.
Two methods:
Random scan: uses beam penetration.
2 layers (Red, Green) phosphors; low speed electrons
excite Red, high speed electrons excite Green, intermediate
speed excite both to get yellow and orange. Color is
controlled by electron beam voltage.
Only produces a restricted set of colors.
Raster scan: uses a shadow mask with three electron guns:
Red, Green, and Blue (RGB color model). Color is produced
by adjusting the intensity level of each electron beam.
Produces a wide range of colors, from 8 to several millions.
DVST - Direct View
Storage Tube
Two electron guns are used in a DVST.
One the primary gun, used to store the picture pattern
Second the flood gun, maintains the picture display.
no refreshing is needed
very complex pictures can be displayed at very
high r esolutions without flicker
Ordinarily do not display color
Selected parts of a picture cannot be erased, to
eliminate a picture section, the entire screen must
be erased and the modified picture redrawn.
Flat Panel Displays
Flat panel displays are video devices that are
thinner, lighter, and require less power than
Examples: wall frames, pocket notepads,
laptop computer screens,
Emissive versus non-emissive:
Emissive panels convert electrical energy into light:
plasma panels, thin-film electroluminescent display
device, light-emitting diodes.
Non-emissive convert light into graphics using
optical effects:
liquid-crystal device (LCD).
Flat Panel Displays
Plasma-panel display:
a mixture of gases between two plates
vertical conducting ribbons are placed
in one plate, and horizontal conducting
ribbons are placed in the other plate
voltage is applied to the two ribbons to
transform gas into glowing plasma of
electrons and ions.
Flat Panel Displays

(from Donald Hearn and Pauline Baker)

Flat Panel Displays
Light-emitting diode:
a matrix of diodes, one per pixel
apply voltage stored in the refresh
convert voltage to produce light in the
Flat Panel Displays
Liquid-crystal displays (LCD):
LCD screens are often used in small devices such as
calculators and laptop monitors.
picture produced by passing light from a light source
through liquid-crystal material
liquid-crystal material can be programmed to either
let the light through or not
liquid-crystal material contains crystals within a liquid
nematic (thread-like) liquid-crystals have rod shape
that can either align to with the light direction or not
(when voltage is applied to conductors)
panel made of rows of horizontal, transparent
apply voltage to two ribbons to make plasma glow
two polarizers ,two conductors, reflector
Flat Panel Displays

(from Donald Hearn and Pauline Baker)

Flat Panel Displays
Liquid-crystal displays (LCD)
Passive matrix LCD
refresh buffer
screen refreshed at 60 frames per
Active matrix LCD
transistor stored at each pixel
prevents charge from leaking out of
Viewing Devices
For the display of 3D scenes.

Often using a vibrating, flexible mirror.

Scan alternate images in alternate frames.

Multiple stereo images (time multiplexing).

Stereoscopic and
Stereoscopic systems are used in virtual
reality systems:
Augmented reality
Immersive reality
Headset generates stereoscopic views
Input devices (gloves, helmet, ) capture
Sensing system in headset tracks users
Scene projected on an arrangement of walls
Input Devices
Input devices
Keyboards, button boxes, dials
Mouse devices
Trackballs and spaceballs
Data gloves
Image scanners
Touch panels
Light pens
Voice systems
Input Devices
Keyboards, button boxes, dials
Standard keyboard
Function keys
Button box
set of input dials
Input Devices
Mouse devices
Mechanical mouse
Rotating ball
Two perpendicular shafts to capture rotation
Optical mouse
Optical sensor
Grid to detect movement
Added widgets
Input Devices
A ball device that can be rotated with
the fingers or palm of hand

Six degrees of freedom
Does not move, detects strain placed
on the ball by trying to move it.
Input Devices
Used for drawing, painting, or selecting positions
Graphics tablet used to input 2D coordinates by activating a hand cursor or stylus
at given positions on a flat surface
Used to trace contours, select precise coordinate positions
Hand held cursor
Grid of wires
Electromagnetic pulses send an electrical signal in stylus or cursor
Sound waves to detect stylus position by microphones
Can be 3D.

Image scanners
The display contains two polarizers, aligned
90degree to each other.
With the display in its OFF (or twisted) state,
light entering the display is plane polarized by
the first polarizer.
This polarized light passes through the liquid
crystal sandwich and then through the second
polarizer and is
reflected back to the display.
Turning the pixel ON (by applying and electric
field) causes the crystal to untwist.
Light now passing through the liquid crystal
sandwich is now absorbed by the second
polarizer. The pixel now appears dark.
Input Devices
Image scanners
Used to store images on a computer
Hand held
Input Devices
Touch panels
Select objects by the touch of a finger
Line of infrared light-emitting diodes (LED) along vertical and horizontal edges
Interrupted when panel is touched
Two transparent plates of material, one conducting, the other resistive
Touch brings the plates to be in contact with one another, causing a voltage
Measure the voltage drop

Light pens
Input Devices
Light pens
Pen-shaped device to select screen
positions by detecting lights coming
from points on the CRT screen
Used to capture position of an object
or select menu options.
Input Devices
Voice systems
Speech recognition systems to
recognize voice commands
Used to activate menu options or to
enter data
Uses a dictionary from a particular
user (learning system).
Hard-copy Devices
Hard-copy devices
2D moving pen with stationary paper
1D pen and 1D moving paper
Impact devices
Inked ribbon
Non impact devices
Laser, ink-jet, xerographic, electrostatic,
Refresh and raster scan
display system
Used in television screens
Unlike DVST and random-scan which
were linedrawing devices, refresh CRT is
a point-plotting device
Raster displays store the display
primitives (lines, characters, shaded
and patterned areas) in a refresh buffer
Refresh buffer (also called frame buffer)
stores the drawing primitives in terms
of points and pixels components
Refresh and raster scan
display system
Entire screen is a matrix of pixels
Each pixel brightness can be controlled
Refresh buffer can be visualized as a set of
horizontal raster lines or a row of individual
Line cannot be drawn directly from one
point to another
Each point is an addressable point in screen
and memory
This causes the effect of aliasing, jaggies
or staircase effect
Refresh/Frame buffer is also called Bit-
Scan conversion of output primitives
(lines, rectangles etc.) done by the
CPU. Slow.
As refresh cycle increases, memory
cycles used by the video controller
increases. Memory is less available
to CPU.
Solution: Graphics Display Processor
Graphics Display Processor
Scan conversion, output primitives,
raster operationsCPU
buffering) Devices

Separete frame
Display System
Processor Memory

D. Proc. Frame Video Monitor

memory. Buffer Controller
Random Scan display
The display must be refreshed at regular intervals
minimum of 30 Hz (fps) for flicker-free display
Refresh Buffer memory space allocated to store
display list or display program for the display
to draw the picture
The display processor interprets the commands in
refresh buffer for plotting
The display processor must cycle through the
list to refresh the phosphor
The display program has commands for point- ,
line, and character plotting
Random Scan display
The display processor sends digital and point
coordinate values to a vector generator
The vector generator converts the digital
values to analog voltages for the beam-deflection
The beam-deflection circuits displace the
beam for writing on the CRTs phosphor coating
Scope of animation with segmentation mixture
static and dynamic parts of a picture