You are on page 1of 12

Computer Science Department

Computer Graphics
Handout 1

Introduction to Computer Graphics

Application of Computer Graphics


Computer graphics refers to the creation, storage and manipulation of pictures and drawings
using a digital computer. With developments in computing technology interactive computer
graphics has become an effective tool for the presentation of information in such diverse fields as
science, engineering, medicine, business, industry, government, art, entertainment, advertising,
education, and training. There is virtually no field in which graphical displays cannot be used to
some advantage and that is the basic reason why application of computer graphics is so
widespread
It is a fact that one picture is worth a thousand words. Therefore, interfaces empowered with
graphics enhance the communication between the computer and its users. Representation of a
huge set of numbers in the form of a graph or a picture helps in a better understanding and
interpretation of the characteristics or pattern of the data contained in the set of numbers. Graphic
displays also improve understanding of complex systems, and visualization of two-dimensional
(2D), three-dimensional (3D) objects: A major application of computer graphics are mentioned
below.

Computer-Aided Design (CAD)


for engineering and architectural systems etc. Objects maybe displayed in a wireframe outline
form. Multi-window environment is also favored for producing various zooming scales and
views. Animations are useful for testing performance.
Presentation Graphics
To produce illustrations which summarize various kinds of data. Except 2D, 3D graphics are
good tools for reporting more complex data.
Computer Art
Painting packages are available. With cordless, pressure-sensitive stylus, artists can produce
electronic paintings which simulate different brush strokes, brush widths, and colors.
Photorealistic techniques, morphing and animations are very useful in commercial art. For films,
24 frames per second are required. For video monitor, 30 frames per second are required.
Entertainment
Motion pictures, Music videos, and TV shows, Computer games
Education and Training

Computer Graphics compile by Abrham Y. Page 1


Training with computer-generated models of specialized systems such as the training of ship
captains and aircraft pilots.
Visualization
For analyzing scientific, engineering, medical and business data or behavior. Converting data to
visual form can help to understand mass volume of data very efficiently.
Image Processing
Image processing is to apply techniques to modify or interpret existing pictures. It is widely used
in medical applications.
Graphical User Interface
A graphical user interface is mouse-oriented paradigm, which allows the user to interact with a
computer. Multiple windows, icons, menus allow a computer setup to be utilized more
efficiently.

Graphical Hardware
Graphic hardware can be divided into two major categories of devices: (1) I nput devices
with which the user interacts to generate necessary instruction or data for creating graphics
(2) Display systems where the graphics are rendered on the monitor screen.

Input Devices
Various devices are available for data input on graphics workstations. Most systems have a
keyboard and one or more additional devices specially designed for interactive input. These
include a mouse, trackball, spaceball, joystick, digitizers, dials, and button boxes. Some other
input devices used in particular applications are data gloves, touch panels, image scanners, and
voice systems.
Keyboards
An alphanumeric keyboard on a graphics system is used primarily as a device for entering text
strings. The keyboard is an efficient device for inputting such nongraphic data as picture labels
associated with a graphics display. Keyboards can also be provided with features to facilitate
entry of screen coordinates, menu selections, or graphics functions.
Cursor-control keys and function keys are common features on general purpose keyboards.
Function keys allow users to enter frequently used operations in a single keystroke, and cursor-
control keys can be used to select displayed objects or coordinate positions by positioning the
screen cursor. Other types of cursor-positioning devices, such as a trackball or joystick, are
included on some keyboards. Additionally, a numeric keypad is, often included on the keyboard
for fast entry of numeric data.
Mouse

Computer Graphics compile by Abrham Y. Page 2


A mouse is small hand-held box used to position the screen cursor. Wheels or rollers on the
bottom of the mouse can be used to record the amount and direction of movement. Another
method for detecting mouse motion is with an optical sensor. For these systems, the mouse is
moved over a special mouse pad that has a grid of horizontal and vertical lines. The optical
sensor detects movement across the lines in the grid.
Trackball and Spaceball
As the name implies, a trackball is a ball that can be rotated with the fingers or palm of the hand
to produce screen-cursor movement. Potentiometers, attached to the ball, measure the amount
and direction of rotation. Trackballs are often mounted on keyboards.
While a trackball is a two-dimensional positioning device, a spaceball provides six degrees of
freedom. Unlike the trackball, a spaceball does not actually move. Strain gauges measure the
amount of pressure applied to the spaceball to provide input for spatial positioning and
orientation as the ball is pushed or pulled in various directions. Spaceballs are used for three-
dimensional positioning and selection operations in virtual-reality systems, modeling, animation,
CAD, and other applications.
Joysticks
A joystick consists of a small, vertical lever (called the stick) mounted on a base that is used to
steer the screen cursor around. Most joysticks select screen positions with actual stick
movement; others respond to pressure the stick. Some joysticks are mounted on a keyboard;
others function as stand-alone units.
The distance that the stick is moved in any direction from its center position corresponds to
screen-cursor movement in that direction. Potentiometers mounted at the base of the joystick
measure the amount of movement, and springs return the stick to the center position when it is
released. One or more buttons can be programmed to act as input switches to signal certain
actions once a screen position has been selected.
Data Glove
Data glove uses to grasp a "virtual" object. The glove is constructed with a series of sensors that
detect hand and finger motions. Electromagnetic coupling between transmitting antennas and
receiving antennas is used to provide information about the position and orientation of the hand.
The transmitting and receiving antennas can each be structured as a set of three mutually
perpendicular coils, forming a three-dimensional Cartesian coordinate system. Input from the
glove can be used to position or manipulate objects in a virtual scene. A two-dimensional
projection of the scene can be viewed on a video monitor, or a three-dimensional projection can
be viewed with a headset.
Digitizers
A common device for drawing, painting, or interactively selecting coordinate positions on an
object is a digitizer. These devices can be used to input coordinate values in either a two-
dimensional or a three-dimensional space. Typically, a digitizer is used to scan over a drawing or
object and to input a set of discrete coordinate positions, which can be joined with straight-line
segments to approximate the curve or surface shapes.

Computer Graphics compile by Abrham Y. Page 3


Image Scanners
Drawings, graphs, color and black-and-white photos, or text can be stored for computer
processing with an image scanner by passing an optical scanning mechanism over the
information to be stored.
Touch Panels
As the name implies, touch panels allow displayed objects or screen positions to be selected with
the touch of a finger.
Light Pens
Pencil-shaped devices are used to select screen positions by detecting the light coming from
points on the CRT screen.
Voice Systems
Speech recognizers are used in some graphics workstations as input devices to accept voice
commands The voice-system input can be used to initiate graphics operations or to enter data.
These systems operate by matching an input against a predefined dictionary of words and
phrases

Display Devices
The display medium for computer graphic-generated pictures has become widely diversified.
Typical examples are CRT-based display, Liquid Crystal, LED and Plasma based display. CRT
display is by far the most common display technology and most of the fundamental display
concepts are embodied in CRT technology. This unit focuses on CRT-based display technologies
explaining the related concepts followed by illustrations of structural and functional components
and working principles of each.
The most prominent part in a personal computer is the display system that makes graphic display
possible. The display system may be attached to a PC to display character, picture and video
outputs. Some of the common types of display systems available in the market are:
1. Raster Scan Displays
2. Random Scan Displays

Computer Graphics compile by Abrham Y. Page 4


3. Flat Panel Displays
The display systems are often referred to as Video Monitor or Video Display Unit (VDU). The
most common video monitor that normally comes with a PC is the Raster Scan type. However,
every display system has three basic parts – the display adapter that creates and holds the image
information, the monitor which displays that information and the cable that carries the image
data between the display adapter and the monitor. Before we discuss the major display systems
let us first know about some basic terms.
Pixel
A pixel may be defined as the smallest size object or colour spot that can be displayed and
addressed on a monitor. Any image that is displayed on the monitor is made up of thousands of
such small pixels (also known as picture elements). The closely-spaced pixels divide the image
area into a compact and uniform two-dimensional grid of pixel lines and columns. Each pixel has
a particular colour and brightness value. Though the size of a pixel depends mostly on the size of
the electron beam within the CRT, they are too fine and close to each other to be perceptible by
the human eye. The finer the pixels the more the number of pixels displayable on a monitor
screen. However, it should be remembered that the number of pixels in an image is fixed by the
program that creates the image and not by the hardware that displays it.
Resolution
There are two distinctly different terms, which are often confused. One is Image Resolution and
the other is Screen Resolution. Strictly speaking image resolution refers to the pixel spacing, i.e.,
the distance from one pixel to the next pixel. A typical PC monitor displays screen images with a
resolution somewhere between 25 pixels per inch and 80 pixels per inch (ppi). In other words,
resolution of an image refers to the total number of pixels along the entire height and width of
the image. For example, 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 = 4,80,000
pixels in the image area.
The internal surface of the monitor screen is coated with red, green and blue phosphor material
that glows when struck by a stream of electrons. This coated material is arranged into an array of
millions of tiny cells–red, green and blue, usually called dots. The dot pitch is the distance
between adjacent sets (triads) of red, green and blue dots.

Pixel therefore, is the smallest element of a displayed image, and dots (red, green and blue) are
the smallest elements of a display surface (monitor screen). The dot pitch is the measure of
screen resolution. The smaller the dot pitch, the higher the resolution, sharpness and detail of the
image displayed.
In order to use different resolutions on a monitor, the monitor must support automatic changing
of resolution modes. Originally, monitors were fixed at a particular resolution, but
for most monitors today display resolution can be changed using software control. This lets you
use higher or lower resolution depending on the need of your application. A higher resolution
display allows you to see more information on your screen at a time and is particularly useful for

Computer Graphics compile by Abrham Y. Page 5


operating systems such as Windows. However, the resolution of an image you see is a function
of what the video card outputs and what the monitor is capable of displaying. To see a high
resolution image such as 1280 × 1024 you require both a video card capable of producing an
image this large and a monitor capable of displaying it.
Cathode-Ray Tubes (CRT)
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.

Electrostatic deflection of the electron beam in a CRT


An electron gun emits a beam of electrons, which passes through focusing and deflection
systems and hits on the phosphor-coated screen. The number of points displayed on a CRT is
referred to as resolutions (eg. 1024x768). Different phosphors emit small light spots of different
colors, which can combine to form a range of colors. A common methodology for color CRT
display is the Shadow-mask meth.

Computer Graphics compile by Abrham Y. Page 6


The light emitted by phosphor fades very rapidly, so it needs to redraw the picture repeatedly.
There are 2 kinds of redrawing mechanisms: Raster-Scan and Random-Scan
RASTER SCAN DISPLAY
This type of display basically employs a Cathode Ray Tube (CRT) or LCD Panel for display.
The CRT works just like the picture tube of a television set. Its viewing surface is coated with a
layer of arrayed phosphor dots. At the back of the CRT is a set of electron guns (cathodes) which
produce a controlled stream of electrons (electron beam). The phosphor material emits light
when struck by these high-energy electrons. The frequency and intensity of the light emitted
depends on the type of phosphor material used and energy of the electrons. To produce a picture
on the screen, these directed electron beams start at the top of the screen and scan rapidly from
left to right along the row of phosphor dots.

They return to the left-most position one line down and scan again, and repeat this to cover the
entire screen. The return of the beam to the leftmost position one line down is called horizontal
retrace during which the electron flow is shut off. In performing this scanning or sweeping type
motion, the electron guns are controlled by the video data stream that comes into the monitor
from the video card. This varies the intensity of the electron beam at each position on the screen.
The instantaneous control of the intensity of the electron beam at each dot is what controls the
colour and brightness of each pixel on the screen. All this happens very quickly, and the entire
screen is drawn in a fraction (say, 1/60th) of a second. An image in raster scan display is
basically composed of a set of dots and lines; lines are displayed by making those dots bright
(with the desired colour) which lie as close as possible to the shortest path between the endpoints
of a line.

Refresh Rate and Interlacing


When a dot of phosphor material is struck by the electron beam, it glows for a fraction of a
second and then fades. As brightness of the dots begins to reduce, the screen-image becomes
unstable and gradually fades out. In order to maintain a stable image, the electron beam must

Computer Graphics compile by Abrham Y. Page 7


sweep the entire surface of the screen and then return to redraw it a number of times per second.
This process is called refreshing the screen. After scanning all the pixel-rows of the display
surface, the electron beam reaches the rightmost position in the bottommost pixel line. The
electron flow is then switched off and the vertical deflection mechanism steers the beam to the
top left position to start another cycle of scanning. This diagonal movement of the beam
direction across the display surface is known as vertical retrace. If the electron beam takes too
long to return and redraw a pixel, the pixel will begin to fade; it will return to full brightness only
nwhen redrawn. Over the full surface of the screen, this becomes visible as a flicker in the image,
which can be distracting and hard on the eyes.

In order to avoid flicker, the screen image must be redrawn fast enough so that the eye cannot
tell that refresh is going on. The refresh rate is the number of times per second that the screen is
refreshed. It is measured in Hertz (Hz), the unit of frequency. The refresh rates are somewhat
standardized.

Some monitors use a technique called interlacing to cheat a bit and allow themselves to display
at a higher resolution than is otherwise possible. Instead of refreshing every line of the screen,
when in an interlaced mode, the electron guns sweep alternate lines on each pass. In the first
pass, odd-numbered lines are refreshed, and in the second pass, even numbered lines are
refreshed. This allows the refresh rate to be doubled because only half the screen is redrawn at a
time. The usual refresh rate for interlaced operation is 87 Hz, which corresponds to 43.5 Hz of
‘real’ refresh in half-screen interlacing.

In the Figure above the odd-numbered lines represent scanning one half of the screen and the
even-numbered lines represent scanning of the other half. There are two separate sets of
horizontal and vertical retrace.

Computer Graphics compile by Abrham Y. Page 8


As we can observe in the figurebelow, The electron beam is swept across the screen one
row at a time from top to bottom. As it moves across each row, the beam intensity is turned on
and off to create a pattern of illuminated spots. This scanning process is called refreshing. Each
complete scanning of a screen is normally called a frame.
The refreshing rate, called the frame rate, is normally 60 to 80 frames per second, or described as
60 Hz to 80 Hz.

Picture definition is stored in a memory area called the frame buffer. This frame buffer
stores the intensity values for all the screen points. Each screen point is called a pixel (picture
element).
On black and white systems, the frame buffer storing the values of the pixels is called a bitmap.
Each entry in the bitmap is a 1 -bit data which determine the on (1) and off (0) of the intensity of
the pixel.
On color systems, the frame buffer storing the values of the pixels is called a pixmap
(Though nowadays many graphics libraries name it as bitmap too). Each entry in the pixmap
occupies a number of bits to represent the color of the pixel. For a true color display, the number
of bits for each entry is 24 (8 bits per red/green/blue channel, each channel 28=256 levels of
intensity value, ie. 256 voltage settings for each of the red/green/blue electron guns).
Random-Scan (Vector Display)

The CRT's electron beam is directed only to the parts of the screen where a picture is to
be drawn. The picture definition is stored as a set of line-drawing commands in a refresh display
file or a refresh buffer in memory.
Random-scan generally have higher resolution than raster systems and can produce
smooth line drawings, however it cannot display realistic shaded scenes.
Display Controller

Computer Graphics compile by Abrham Y. Page 9


For a raster display device reads the frame buffer and generates the control signals for the screen,
ie. the signals for horizontal scanning and vertical scanning. Most display controllers include a
color map (or video look-up table). The major function of a color map is to provide a mapping
between the input pixel value to the output color.
Anti-Aliasing
On dealing with integer pixel positions, jagged or stair step appearances happen very usually.
This distortion of information due to under sampling is called aliasing. A number of ant aliasing
methods have been developed to compensate this problem.
One way is to display objects at higher resolution. However there is a limit to how big we can
make the frame buffer and still maintaining acceptable refresh rate.

GRAPHICS SOFTWARE
There are two general classifications for graphics software: general programming packages and
special-purpose applications packages. A general graphics programming package provides an
extensive set of graphics functions that can be used in a high-level programming language, such
as C or FORTRAN. An example of a general graphics programming package is the GL
(Graphics Library) system on Silicon Graphics equipment. Basic functions in a general package
include those for generating picture components (straight lines, polygons, circles, and other
figures), setting color and intensity values, selecting views, and applying transformations. By
contrast, application graphics packages are designed for nonprogrammers, so that users can
generate displays without worrying about how graphics operations work. The interface to the
graphics routines in such packages allows users to communicate with the programs in their own
terms. Examples of such applications packages are the artist's painting programs and various
business, medical, and CAD systems.
Coordinate Representations
With few exceptions, general graphics packages are designed to be used with Cartesian
coordinate specifications. If coordinate values for a picture are specified in some other reference
frame (spherical, hyperbolic, etc.), they must be converted to Cartesian coordinates before they
can be input to the graphics package.
Special-purpose packages may allow use of other coordinate frames that are appropriate to the
application. In general; several different Cartesian reference frames are used to construct and
display a scene. We can construct the shape of individual objects, such as trees or furniture, in a
scene within separate coordinate reference frames called modeling coordinates, or sometimes
local coordinates or master coordinates. Once individual object shapes have been specified, we
can place the objects in to appropriate positions within the scene using a reference frame called
world coordinates. Finally, the world-coordinate description of the scene is transformed to one
or more output-device reference frames for display. These display coordinate systems are
referred to as device coordinates. Or screen coordinates in the case of a video monitor. Modeling
and world coordinate definitions allow us to set any convenient floating-point or integer
dimensions without being hampered by the constraints of a particular output device. For some
Computer Graphics compile by Abrham Y. Page 10
scenes, we might want to specify object dimensions in fractions of a foot, while for other
applications we might want to use millimeters, kilometers, or light-years.

Generally, a graphics system first converts world-coordinate positions to normalized device


coordinates, in the range from 0 to 1, before final conversion to specific device coordinates. This
makes the system independent of the various devices that might be used at a particular
workstation.
Graphics Functions
A general-purpose graphics package provides users with a variety of functions for
creating and manipulating pictures. These routines can be categorized according to whether they
deal with output, input, attributes, transformations, viewing, or general control.
The basic building blocks for pictures am referred to as output primitives. They include
character strings and geometric entities, such as points, straight lines, curved Lines, filled areas
(polygons, circles, etc.), and shapes defined with arrays of color points. Routines for generating
output primitives provide the basic tools for constructing pictures.
Attributes are the properties of the output primitives; that is, an attribute describes how a
particular primitive is to be displayed. They include intensity and color specifications, line styles,
text styles, and area-filling patterns. Functions within this category can be used to set attributes
for an individual primitive class or for groups of output primitives.
We can change the size, position, or orientation of an object within a scene using
geometric transformations. Similar modeling transformations are used to construct a scene using
object descriptions given in modeling coordinates.
Given the primitive and attribute definition of a picture in world coordinates, a graphics package
projects a selected view of the picture on an output device. Viewing transformations are used to
specify the view that is to be presented and the portion of the output display area that is to be
used.
Pictures can be subdivided into component parts, called structures or segments or objects,
depending on the software package in use. Each structure defines one logical unit of the picture.
A scene with several objects could reference each individual object in a-separate named
structure. Routines for processing structures carry out operations such as the creation,
modification, and transformation of structure.
Interactive graphics applications use various kinds of input devices, such as a mouse, a
tablet, or a joystick. Input functions are used to control and process the data flow from these
interactive devices
Software standards
The primary goal of standardized graphics software is portability. When packages are designed
with standard graphics functions, software can he moved easily from one hardware system to
another and used in different implementations and applications. Without standards, programs
designed for one hardware system often cannot be transferred to another system without
extensive rewriting of the programs.
Computer Graphics compile by Abrham Y. Page 11
International and national standards planning organizations in many countries have
cooperated in an effort to develop a generally accepted standard for computer graphics. After
considerable effort, this work on standards led to the development of the Graphical Kernel
System (GKS).This system was adopted as the first graphics software standard by the
International Standards Organization (ISO) and by various; national standards organizations,
including the American National Standards Institute (ANSI).Although GKS was originally
designed as a two-dimensional graphics package, a three-dimensional GKS extension was
subsequently developed. The second software standard to be developed and a p proved by the
standards organizations was PHIGS (Programmer's Hierarchical Interactive Graphics
standard), which is an extension of GKS .Increased capabilities for object modeling, color
specifications, surface rendering, and picture manipulations are provided In PHIGS.
Subsequently, an extension of PHIGS, called PHIGS+, was developed to provide three-
dimensional surface-shading capabilities not available in PHIGS.
Standard graphics Functions are defined as a set of Specifications that is Independent of
any programming language. A language binding is then defined for a particular high-level
programming language. This binding gives the syntax for accessing the various standard
graphics functions from this language.

Computer Graphics compile by Abrham Y. Page 12

You might also like