Com 422 Computer Graphics
Com 422 Computer Graphics
MODULE ONE
Today there are very few aspects of our lives not affected by computers. Practically
every cash or monetary transaction that takes place daily involves a computer. In many
cases, the same is true of computer graphics. Whether you see them on television, in
newspapers, in weather reports or while at the doctor’s surgery, computer images are all
around you. “A picture is worth a thousand words” is a well-known saying and
highlights the advantages and benefits of the visual presentation of our data.
Computer graphics is an art of drawing pictures on computer screens with the help of
programming. It involves computations, creation, and manipulation of data. In other
words, we can say that computer graphics is a rendering tool for the generation and
manipulation of images.
Computer graphics generally means creation, storage and manipulation of models and
images. Such models come from diverse and expanding set of fields including physical,
mathematical, artistic, biological, and even conceptual (abstract) structures.
Computer graphics are any types of images created using any kind of computer. There
is a vast amount of types of images a computer can create. Also, there are just as many
ways of creating those images. Images created by computers can be very simple, such as
lines and circles, or extremely complex such as complicated rendered animations.
Computer graphics is concerned with producing images and animations (or sequences of
images) using a computer. This includes the hardware and software systems used to make
1
these images. The task of producing photo-realistic images is an extremely complex one,
but this is a field that is in great demand because of the nearly limitless variety of
applications. The field of computer graphics has grown enormously over the past 10–20
years, and many software systems have been developed for generating computer graphics
of various sorts. This can include systems for producing 3-dimensional models of the
scene to be drawn, the rendering software for drawing the images, and the associated
user-interface software and hardware.
The field of computer graphics dates back to the early 1960’s with Ivan Sutherland, one
of the pioneers of the field. This began with the development of the (by current standards)
very simple software for performing the necessary mathematical transformations to
produce simple line-drawings of 2- and 3-dimensional scenes. As time went on, and the
capacity and speed of computer technology improved, successively greater degrees of
realism were achievable. Today it is possible to produce images that are practically
indistinguishable from photographic images (or at least that create a pretty convincing
illusion of reality).
Today most graphicist want an Intel PC with at least 256 MB of memory and a 10 GB
hard drive. Their display should have graphics board that supports real-time texture
mapping. A flatbed scanner, color laser printer, digital video camera, DVD, and MPEG
encoder/decoder are the peripherals one wants. The environment for program
development is most likely Windows and Linux, with Direct 3D and OpenGL, but Java
3D might become more important. Programs would typically be written in C++ or Java.
What will happen in the near future, difficult to say, but high definition TV (HDTV) is
poised to take off (after years of hype). Ubiquitous, untethered, wireless computing
should become widespread, and audio and gestural input devices should replace some of
the functionality of the keyboard and mouse.
2
THE PICTURE ELEMENT: BLOCK PIXEL AND LINE
A pixel (short for picture element, using the common abbreviation “pix” for “picture”)
is one of the many tiny dots that make up the representation of a picture in
a computer memory. Each such information element is not really a dot, nor a square,
but an abstract sample.
With care, pixels in an image can be reproduced at any size without the appearance of
visible dots or squares, but in many contexts, they are reproduced as dots or squares and
can be visibly distinct when not fine enough.
A pixel is the most basic component of any computer graphics. It corresponds to the
smallest thing that can be drawn on a computer screen. Every computer graphics is made
up of a grid of pixels. When these pixels are painted onto the screen, they form an image.
This grid of pixels is called a bitmap.
A bitmap is a collection of pixels that describes an image, in human terms, a complete
picture. A bitmap can be of various bit depth and resolution. Basically, a bitmap is an
array of pixels.
In black & white, each pixel can be represented by 1 bit (0,1), a ‘1’ if the pixel is black,
or a ‘0’ if the pixel is white. The computer opens a black & white bitmapped image, then
it starts looking for numbers that describe image information. Every time it comes to a
‘0’ it draws a white pixel. When it comes to a ‘1’ it draws a black pixel.
Sometimes you need more than 1 bit per pixel. This depends on the bit depth of an image.
3
The bits below is the Binary data describing the above image
00000000000000000011110000000000000000
00000000000000001100001100000000000000
00000000000000010000000010000000000000
00000000000000100000000001000000000000
00000000000000100010001001000000000000
00000000000001000111011100100000000000
00000000000001000010001000100000000000
00000000000001000000000000100000000000
00000000000001000000000000100000000000
00000000000001001000000100100000000000
00000000000000100100001001000000000000
00000000000000100011110001000000000000
00000000000000010000000010000000000000
00000000000000001100001100000000000000
00000000000000000011110000000000000000
00011110010000000000000000000000000000
01100010010000000000000000000000000000
11000100100000000000000000000000000000
00000100100001110001011000101100100100
00111111110010010001101000110101100100
00001001000100100111001011100101001000
00010010000101101010010101001011011010
00010010000110110111111011111101101100
00000000000000000100000010000000011000
00000000000000001100000110000000110000
00000000000000001000000100000000100000
PIXELATION
Pixelation is a process or event that occurs when an original bitmapped graphic image
lost its details when the image gets scaled-up. When you enlarge a bit mapped image,
you will get a pixelated look. For example, if you are planning to print out an image that
was originally 3 inches by 3 inches as 6 inches by 6 inches, you will get a pixelated look.
The bitmapped graphics images/pictures below demonstrate the occurrence of Pixelation
as the original images/pictures were scaled-up or enlarged.
5
(ii) Object Oriented Graphics:
You create object oriented graphics in a drawing program. When you create objects in a
drawing program, you can still edit them after you have done something else. For
example, if you draw a circle in one place, then draw a rectangle in another place, you
can still select the circle and change its size and location. This is possible because object
oriented graphics are stored as dimensions and formulas, unlike bit mapped graphics
which are stored as individual pixels. When a drawing program opens a drawing file, it
6
will look for objects, not pixels. A drawing file may be thought of as a series of
instructions like the ones below, but in a computer language which most normal people
cannot understand.
Draw a circle at the point that is 100 pixels to the right and 140 pixels down from •the
top-left corner of the screen with the radius of 25 pixels. There are advantages as well as
disadvantages to object oriented graphics over bitmapped graphics. As already
mentioned, object oriented graphics can still be modified as separate objects after being
modified, unlike bitmapped which cannot. Second, object oriented graphic files (drawing
files) are usually much smaller in size than bitmapped graphics. Third, you can enlarge
an object oriented graphic to any size, and it will not loose detail. That is because most
object oriented graphics are resolution-independant. A disadvantage is that they are
usually harder to create, and cannot have many interesting special effects done to them,
such as bluring for example.
7
Every point you can think of, every atom in space, has its own unique place occupied
only by itself. This place might change with time (the aircraft flies from point A to point
B), but at any given instant, it has a unique location. Every point has an address, called
its coordinates, which describes its location relative to another known location.
A typical Cartesian coordinate system is defined by x and y axes. Each axis has a unit of
length or distance (such as metres or miles). The axes cross at the point where the value
of both x and y is zero; this is called the origin (0,0).
Below is an example showing the coordinates of five different points within a two-
dimensional Cartesian system with the axes conventionally labelled as x (horizontal) and
y (vertical). Each of the five points is defined by two numbers, the first of which is its
distance perpendicular to the y-axis (its x value) and the second is its distance
perpendicular to the x axis (its y value). Note that the direction from the origin is also
important, as this will determine whether the values of x and y are positive or negative.
8
When you come across a diagram such as the one above, for example a map or perhaps
a collection of data, you are likely to need to do one of two things:
Either you have a point on a chart and you need to determine its coordinates;
Or you have the coordinates and you need to work out the location of the point.
To determine the coordinates of a point, consider Point A in the diagram (marked in red
in the positive x and y quadrant, or Quadrant 1). First, measure how far it is along the x-
axis from the origin, i.e. its perpendicular distance from the y-axis. This provides your x
coordinate, which has a value of 2. Next, measure how far the point is along the y-axis,
in a perpendicular direction from the x axis. This gives your y coordinate, which has a
value of 3.
9
FINDING THE LOCATION OF A POINT FROM ITS COORDINATES
In the second instance, you might be given the coordinates (−5.5, −1.5) and need to find
the position of that point on the graph or map. In this case, you first travel along the
negative x-axis until you reach the value −5.5. Then from that position, move in a
perpendicular direction −1.5 units, i.e. 1.5 units parallel to the negative y axis, and mark
your point. Alternatively you can draw a vertical line at x=−5.5 and horizontal line at
y=−1.5.
Where the two lines intersect is the point (−5.5, −1.5), which is shown on the diagram
as Point B, in Quadrant 3.
The first two coordinates, x and y, are determined in the same way as in a two-
dimensional system. These describe the position of the point if it were projected
downwards (or upwards) at right angles onto the x-y plane. The three-dimensional
system also has a z-axis, which lies perpendicular to the x-y plane. The origin of a three-
dimensional Cartesian system is the point at which x, y and z are all equal to zero (0,0,0).
It is unlikely that you will need to use 3D Cartesian coordinate systems in everyday life
unless you are involved with engineering, physics, architecture or other applications of
computer-aided design.
10
11
LINE GENERATION ALGORITHM: THE INCREMENTAL METHODS
A line connects two points. It is a basic element in graphics. To draw a line, you need
two points between which you can draw a line. In the line generation algorithms, we refer
to one point of line as x0, y0 and the second point of line as x1, y1.
Any procedure that identifies those portions of a picture that are either inside or outside
of a specified region or space is known as clipping.
Point Clipping
Clipping a point from a given window is very easy. Consider the following figure, where
the rectangle indicates the window.
Point clipping tells us whether the given point X, Y is within the given window or not,
and decides whether we will use the minimum and maximum coordinates of the window.
The X-coordinate of the given point is inside the window, if X lies in between
Wx1 ≤ X ≤ Wx2. Same way, Y coordinate of the given point is inside the window, if Y
lies in between Wy1 ≤ Y ≤ Wy2.
13
Line Clipping
The concept of line clipping is same as point clipping. In line clipping, we will cut the
portion of line which is outside of window and keep only the portion that is inside the
window.
Generally, this method speeds up the processing of line segments, by performing initial
tests that reduce the number of intersections that must be calculated. Every line endpoint
in a picture is assigned a 4-digit binary code, called a region code that identifies the
location of the point relative to the boundaries of the clipping rectangle.
This algorithm uses the clipping window as shown in the following figure. The minimum
coordinate for the clipping region is (XWmin, YWmin) and the maximum coordinate
for the clipping region is (XWmax, YWmax).
14
We will use 4-bits to divide the entire region. These 4 bits represent the Top, Bottom,
Right, and Left of the region as shown in the following figure. Here,
the TOP and LEFT bit is set to 1 because it is the TOP-LEFT corner.
Line can be completely inside the window. This line should be accepted.
Line can be completely outside of the window. This line will be completely
removed from the region.
15
Line can be partially inside the window. We will find intersection point and draw
only that portion of line that is inside region.
Algorithm
Step 2 − If both endpoints have a region code 0000 then accept this line.
Step 3 − Else, perform the logical AND operation for both region codes.
Step 3.1 − If the result is not 0000, then reject the line.
Step 3.2.1 − Choose an endpoint of the line that is outside the window.
Step 3.2.2 − Find the intersection point at the window boundary base on region code.
Step 3.2.3 − Replace endpoint with the intersection point and update the region code.
Step 3.2.4 − Repeat step 2 until we find a clipped line either trivially accepted or trivially
rejected.
A polygon can also be clipped by specifying the clipping window. Sutherland Hodgeman
polygon clipping algorithm is used for polygon clipping. In this algorithm, all the vertices
of the polygon are clipped against each edge of the clipping window.
First the polygon is clipped against the left edge of the polygon window to get new
vertices of the polygon. These new vertices are used to clip the polygon against right
edge, top edge, bottom edge, of the clipping window as shown in the following figures.
16
While processing an edge of a polygon with clipping window, an intersection point is
found if edge is not completely inside clipping window and then a partial edge from the
intersection point to the outside edge is clipped. The following figures show left, right,
top and bottom edge clippings.
17
Text Clipping
Various techniques are used to provide text clipping in a computer graphics. It depends
on the methods used to generate characters and the requirements of a particular
application. There are three methods for text clipping which are listed below.
In all or none string clipping method, either we keep the entire string or we reject entire
string based on the clipping window. As shown in the above figure, STRING2 is entirely
inside the clipping window so we keep it and STRING1 being only partially inside the
window, we reject.
The following figure shows all or none character clipping.
This clipping method is based on characters rather than entire string. In this method if
the string is entirely inside the clipping window, then we keep it. If it is partially outside
the window, then
18
You reject only the portion of the string being outside
If the character is on the boundary of the clipping window, then we discard that
entire character and keep the rest string.
The following figure shows text clipping.
This clipping method is based on characters rather than the entire string. In this method
if the string is entirely inside the clipping window, then we keep it. If it is partially outside
the window, then
GEOMETRIC TRANSFORMATION
We are not essentially modifying the pictures, but a picture in the center of the screen
needs to be shifted to the top left hand corner, say, or a picture needs to be increased to
twice its size or a picture is to be turned through 900 . In all these cases, it is possible to
view the new picture as really a new one and use algorithms to draw them, but a
better method is, given their present form, try to get their new counterparts by
19
operating on the existing data. This concept is called transformation. Transformation
means changing some graphics into something else by applying rules. We can have
various types of transformations such as translation, scaling up or down, rotation,
shearing, etc. When a transformation takes place on a 2D plane, it is called 2D
transformation.
Homogenous Coordinates
To shorten this process, we have to use 3×3 transformation matrix instead of 2×2
transformation matrix. To convert a 2×2 matrix to 3×3 matrix, we have to add an extra
dummy coordinate W.
In this way, we can represent the point by 3 numbers instead of 2 numbers, which is
called Homogenous Coordinate system. In this system, we can represent all the
transformation equations in matrix multiplication. Any Cartesian point P X, Y can be
converted to homogenous coordinates by P’ (Xh, Yh, h).
Translation
A translation moves an object to a different position on the screen. You can translate a
point in 2D by adding translation coordinate (tx, ty) to the original coordinate X, Y to get
the new coordinate X′, Y′
20
From the above figure, you can write that:
X’ = X + tx
Y’ = Y + ty
The pair (tx, ty) is called the translation vector or shift vector. The above equations can
also be represented using the column vectors.
Rotation
In rotation, we rotate the object at particular angle θ theta from its origin. From the
following figure, we can see that the point P X, Y is located at angle φ from the
horizontal X coordinate with distance r from the origin.
Let us suppose you want to rotate it at the angle θ. After rotating it to a new location,
you will get a new point P’ X′, Y′.
21
Using standard trigonometric the original coordinate of point P X, Y can be represented
as
22
The rotation angle can be positive and negative.
For positive rotation angle, we can use the above rotation matrix. However, for negative
angle rotation, the matrix will change as shown below
Scaling
To change the size of an object, scaling transformation is used. In the scaling process,
you either expand or compress the dimensions of the object. Scaling can be achieved by
multiplying the original coordinates of the object with the scaling factor to get the
desired result.
Let us assume that the original coordinates are X, Y the scaling factors are (SX, SY), and
the produced coordinates are X′,Y′. This can be mathematically represented as shown
below:
The scaling factor SX, SY scales the object in X and Y direction respectively. The above
equations can also be represented in matrix form as below:
OR
P’ = P . S
23
Where S is the scaling matrix. The scaling process is shown in the following figure.
If we provide values less than 1 to the scaling factor S, then we can reduce the size of
the object. If we provide values greater than 1, then we can increase the size of the object.
Reflection
Reflection is the mirror image of original object. In other words, we can say that it is a
rotation operation with 180°. In reflection transformation, the size of the object does not
change. The following figures show reflections with respect to X and Y axes, and about
the origin respectively.
24
Shear
A transformation that slants the shape of an object is called the shear transformation.
There are two shear transformations X-Shear and Y-Shear. One shifts X coordinates
values and other shifts Y coordinate values. However; in both the cases only one
coordinate changes its coordinates and other preserves its values. Shearing is also termed
as Skewing.
X-Shear
The X-Shear preserves the Y coordinate and changes are made to X coordinates, which
causes the vertical lines to tilt right or left as shown in below figure.
Y-Shear
The Y-Shear preserves the X coordinates and changes the Y coordinates which causes
the horizontal lines to transform into lines which slopes up or down as shown in the
following figure.
25
MODULE TWO
The computer on receiving signals from the input device can modify the displayed picture
appropriately. To the user it appears that the picture is changing instantaneously in
response to his commands. He can give a series of commands, each one generating a
graphical response from the computer. In this way he maintains a conversation, or
dialogue, or interaction with the computer.
Advantages:
1. Higher Quality
2. More precise results or products
3. Greater Productivity
26
program and will work according to the instructions given in the program linearly. The
image is totally under the control of program instructions not under the user. In non-
interactive computer graphics, the picture is produced on the monitor, and the user does
not have any control over the image, that is, the user cannot make any change in the
rendered image. Non-interactive Graphics involves only one-way communication
between the computer and the user, user can see the produced image, and he cannot make
any change in the image. One example of it are Titles shown on T.V, cartoon, screen
savers.
All operations on computers are in terms of 0s and 1s and hence figures are also to be
stored in terms of 0s and 1s. Thus, a picture file, when viewed inside the memory, can
be no different from other files, than a string of 0s and 1s. However, their interpretation
when they are to be displayed makes the difference. Pictures are actually formed with
the help of frame-buffer.
Frame buffer is a storage device and stores the image in terms of 0s and 1s. It contains
the 0s and 1s in terms of 8s, or multiples of 8s in a row. These 0s and 1s will be read by
display controller one line at a time and sent to the screen after converting them from
digital to analog. The display controller reads the contents of frame buffer one line at a
time or entire digits at time. These digital images after converting into the analog will
be displayed on the screen. The figure below illustrates this.
27
Interactive graphics display consists of four components
a) A display controller
c) A television monitor/screen
d) A video controller
The display controller gets the inputs and commands from the user and determines the
image to be displayed on the monitor. The display controller will divide the image into
a number of pixels. This image which is to be displayed is stored in the frame buffer.
The image will be stored as a matrix of intensity values.
The image will be displayed onto the television monitor and the video controller will act
as a simple interface that passes the contents of the frame buffer to the monitor. The
image must be repeatedly passed to the monitor, 30 or more times a second. This helps
you to maintain a steady picture on the screen.
In the frame buffer the image is stored as a pattern of binary digital numbers. These
binary digital numbers represents a rectangular array of picture elements or pixels (a
picture can be divided into a number of picture elements or pixels.
So corresponding to each pixel you have a binary digital number in the frame buffer. If
your image is a black and white image you can represent the black pixels by 0s and white
pixels by 1s. Therefore a 16 X 16 array of black and white pixels could be represented
by the binary values stored in the 32 8-bit bytes.
The video controller simply reads each successive byte of data from the frame buffer and
converts its 0s and 1s into the corresponding video signal. This signal is then fed into the
TV monitor, producing a black and white pattern on the screen. The video controller repeats
this operation 30 times a second in order to maintain a steady picture on the TV screen. In
order to modify this image, all that needs to be done is to modify the frame buffers contents.
Set the frame buffer with a new set of values so that it represents the new image. In this
way we can achieve effects like a rotation, translation, scaling, skewing.
28
MODULE THREE
Interactions with graphical image on the computer screen involves the use of hardware
devices for input of graphical images and output of graphical images. These devices are
known as GRAHICS INPUT AND OUTPUT DEVICES.
(1) MOUSE
A mouse is a lightweight, small device used to control the movement of the cursor on a
computer screen. Usually, the mouse moves on a flat surface. A mouse contains two or
three buttons. Every button performs a different task. The mouse can be considered as a
positioning and pointing device.
29
Functions of Mouse
The following are functions of a mouse:
Clicking
Right-clicking
Dragging
Scrolling
Double Clicking
30
(3) JOYSTICK
A joystick has two parts: a base and a stick. We can move the stick in every direction to
shift the object from one position to another position on the computer screen. The
joystick is similar to a mouse or trackball. Mostly the joystick is used to play computer
games. A joystick has a fast interface and also used in computer-aided design.
31
(5) POINTING STICK
The pointing device is also known as the Pressure-Sensitive device. It exists between the
keys of the keyboard. It is similar to a pencil eraser. The pointing stick works like a
mouse. When we touch the finger on the pointing stick, the cursor moves on the computer
screen. A pointing stick does not need any extra space like a mouse. It is mostly used in
notebooks.
DRAGGING
Dragging is used to move an object from one position to another position on the computer
screen. To drag any object, first, we have to select the object that we want to move on the
screen by holding the mouse button down. As cursor moved on the screen, the object is
also moved with the cursor position. When the cursor reached the desired position, the
button is released. The following diagram represents the dragging procedure:
32
GRAPHICS OUTPUT DEVICES
The knowledge of computer output devices examples has become very important
because everywhere, output devices being used, whether it is a school, hospital, bank,
shopping malls e.tc. Output Devices Output devices are the electronic hardware parts
of the computer that converts the information into readable form. It can be text, graphics,
audio, or video. Output devices examples can be defined as “when the computer
receives various types of data and instructions through input devices like a keyboard (by
typing) and mouse (by clicking) and processes it and gives results through the output
devices like Monitor and printer.
Output devices show the results of data processed in a computer. Monitor and printer
are two mainly used examples of output devices. These outputs take the device into
machine signals and convert them into human language.
(1) A MONITOR
Monitors, commonly called as Visual Display Unit (VDU), are the main output device
of a computer. It forms images from tiny dots, called pixels that are arranged in a
rectangular form. The sharpness of the image depends upon the number of pixels.
Monitors are the most crucial output devices of a computer. Without it, the computer is
incomplete. The monitor is a versatile device of the computer for visual display of all
types of information. The monitor is designed to display symbolic and graphical
information. It shows all the data and information as Soft Copy on its screen. It acts as
an interface between the CPU and the user. A cable is connected with a video adapter
set up with the computer’s motherboard to display the data. Anyone can view Files,
photos, videos, texts, graphics, and tables in real-time through the monitor.
They are increasingly being produced thinner in width and with advanced technologies
such as LED, plasma, or liquid crystal. There are basically two kinds of viewing screen
used for monitors.
The CRT display is made up of small picture elements called pixels. The smaller the
pixels, the better the image clarity or resolution. It takes more than one illuminated pixel
to form a whole character, such as the letter ‘e’ in the word help.
A finite number of characters can be displayed on a screen at once. The screen can be
divided into a series of character boxes - fixed location on the screen where a standard
character can be placed. Most screens are capable of displaying 80 characters of data
horizontally and 25 lines vertically. These are some disadvantages of CRT.
Large in Size
High power consumption
The flat-panel display refers to a class of video devices that have reduced volume, weight
and power requirement in comparison to the CRT. You can hang them on walls or wear
them on your wrists. Current uses of flat-panel displays include calculators, video
games, monitors, laptop computer, and graphics display.
Emissive Displays − Emissive displays are devices that convert electrical energy
into light. For example, plasma panel and LED (Light-Emitting Diodes).
(2) A PRINTER
A printer is an electronic external output devices of computer used to print digital
information on paper as a hard copy. The main task of printers is to convert the data
from soft copy to hard copy on the computer.
34
The printer prints the files stored in a computer (data can be in text form), it can be small
or big as per the page size. Printers are used to print signs, office documents at offices,
homes, PPT, and business establishments. The resolution or clarity of images
produced by a printer is measures in DPI (dots per inch) resolution. The more dots per
fleas a printer has, the better quality can be printed and seen more clearly.
Usually, the printer is connected to a computer with a data cable or only a wireless
connection with Wi-Fi. At present, many digital printers featured with the latest wireless
technologies like Bluetooth, Wi-Fi, or cloud. Due to this, it becomes easier to complete
the printing task.
There are two types of printers:
(a) The Impact Printers
(b) The Non-Impact Printers
(3) A PLOTTER
A plotter is an output device that prints graphics with high-quality images in many color
formats. It is analogous to a printer but has more advanced features.
35
The plotter allows us not only for graphic design but also to print large maps, architectural
drawings, large-format printing, create pictures, 3D postcards, advertising signs, charts.
The printer prints only on paper, but the plotter can print on cardboard, fabric, film, and other
synthetic materials. Some unique models allow you to print on T-shirts, bags, other
lightweight clothing, and even round objects such as cups.
Plotters are different from printers because they are more accurate, faster with high-
resolution graphics. That’s why plotters used by Engineers and architects fields as
engineering applications, where accuracy is mandatory.
Printers design the pictures as per the commands given by the computer user. In this case,
pens are used to draw multicolor plotters using different color pens.
(5) SPEAKERS
A speaker is a hardware output device connected with a computer to produce the audios. The
sound produced by computer speakers is made by a hardware component whose name is
a sound card that pre-installed with the computer.
The word “speaker” is not a technical term. The real name of the device is “dynamic head.”
This Speaker can now be found on many devices, for example, on a TV, radio, telephone,
children’s toys, and others.
The audio signal is sent through the computer’s sound card to produce the sound coming
from a computer speaker. Many LAPTOP already has the inbuilt Speaker at the upper end
36
of the keyboard. The Speaker is inbuilt with the motherboard is called Internal Speaker. One
can need an external speaker separately when producing the sound from the computer in a
more loud way.
(6) A HEADPHONE
Headphones are also known as earphones. Headphones are output devices with which you
can listen to any sound signals transmitted by an electronic device. These are hardware
devices that produce audio privately after being connected to smartphones or computers
through a wireless connection.
The primary purpose of using headphones or earphones is to listen to the audio privately,
mainly in a crowd, and avoid disturbing others. The headphone takes the audio input from
the sound card (any connected device) and converts it into audio output in the form of wave
sound. Many headphones or earphones are launched with advanced technology and superior
sound technology in today’s digital world. These headphones connect to any musical device
with a jack port of 3.5MM.
37
This device is responsible for processing data – machine code and translating it into an
accessible image. In simple words, the video adapter is engaged in the output process of
translating the program code into a user-friendly image on the monitor, TV, or any other
display. Nowadays, to work in professional video processing programs, playing high
definition games, 3D modeling, designing videos, and 3D games with elevated details, you
need an external video card.
(9) A GPS
A GPS is a space-based satellite navigation output device that determines the time and
location information in all weather conditions and allows you to find the desired object on
the map, whether it is situated in any place on the Earth. The main output of GPS
is providing location, weather conditions, and also tracking.
Almost every modern person has used GPS navigation on their smartphone or tablet, even
laptops too. The need for GPS can arise at any time for people of different professions and
different occupational needs. This GPS is a satellite-based navigation system made up of a
network of Satellites placed in the orbit of the Earth. GPS can work in any weather, in any
place of the world, up to 24 hours a day. Simultaneously, the best point is that you do not
have to pay any subscription fees or setup charges.
38
MODULE FOUR
VECTORS IN GRAPHICS
Vectors can be added and subtracted among themselves. Vectors can be multiplied and
divided by a scalar. However, unlike real number multiplication, vectors cannot be
multiplied among themselves. Instead, two special type of vector multiplication exists
called: Dot Product and Cross Product.
39
ADDITION AND SUBTRACTION
Addition
In vector addition, each vector component are individually added to the corresponding
component in the second vector. Vector addition is represented mathematically as:
40
Graphically, vector addition is represented as follows:
Subtraction
In vector subtraction, the components of the vectors are subtracted from each other.
Vector subtraction is represented mathematically as:
41
For example, subtracting two three-dimensional vectors is done as follows:
42
SCALAR MULTIPLICATION AND DIVISION
43
Graphically, vector scalar multiplication is represented as follows:
VECTOR PRODUCT
Unlike real numbers, vectors do not have a single multiplication operation. They have
two distinct type of product operations; the dot product and cross product. The dot
product produces a scalar and is mainly used to determine the angle between vectors. The
cross product produces a vector perpendicular to the multiplicand and multiplier vectors.
Dot Product
The Dot Product is a vector operation that calculates the angle between two vectors.
The dot product is calculated in two different ways.
Version 1
In the above equation, information about the angle between the vectors is missing.
However, the result from this equation can tell us the direction of each vector. For
example, if the dot product is equal to 1, it means that both vectors have the same
44
direction. If the dot product is 0, it means that both vectors are perpendicular on each
other. Finally, if the dot product is -1, it means that both vectors are heading in opposite
directions.
Version 2
If we are interested in finding the angle between two vectors, the dot-product equation
below can be used.
Cross Product
Two vectors produces a plane. A cross product operation produces a vector that is
perpendicular to both vectors. The cross product of two vectors is calculated as follows:
It is important to remember that a cross product can only be calculated with vectors in
three-dimensions. If vectors reside in two-dimensional space, and the cross product is
required, the vectors must be converted to three-dimensional vectors.
45
MAGNITUDE OF A VECTOR
A vector magnitude represents the length of a vector. The length of a vector is calculated
as follows:
Graphically, a vector's magnitude is the hypotenuse of the triangle formed in the image
below:
46
UNIT VECTOR
A very useful concept in computer graphics is what is known as a unit vector. A unit
vector is a vector with length of 1 unit. The process of converting a non-unit vector to a
unit vector is called Normalization. To normalize a vector, each component is divided by
the length/magnitude of the vector or (multiplied by the inverse of the length/magnitude
of the vector). Mathematically this is represented as:
47
48
MODULE FIVE
(EDITTING PICTURES)
Images are important part of today's digital world. File formats are essential when it
comes to compatibility and storing images. An image file format is a standard way to
organize and store image data. It defines how the data is arranged and the type of
compression (if any) to be used. There are several dozens of different image file formats
choosing the right image file format to store your image is of vital importance.
49
A RASTER GRAPHICS
A. RESOLUTION
Raster graphics depend upon having a resolution, which is counted in dpi (dots per inch).
The lower the resolution the smaller the file size. Low-resolution raster graphics would
normally be set to 72 dpi and are used very often for web sites and presentations that are
intended to only be viewed on a computer screen. High-resolution raster graphics would
normally be set to 300 dpi and are mostly used when the image is intended to be printed.
B. SCALING
High-resolution raster graphics would not be a good choice for web or screen use as the
higher dpi would not be noticeable at all (and so of no benefit) and the higher file size
would mean the image takes longer to load into the webpage. A high-resolution graphic
(300 dpi) can be resized and scaled down to being a low-resolution version (72 dpi) but
we cannot scale up a low-resolution graphic to becoming high-resolution. So, it is
advantageous to try and get hold of as high a resolution raster image as possible.
50
A. Graphics Interchange Format (GIF)
B. Joint Photographic Expert Group (JPEG)
C. Portable Network Graphics (PNG)
D. Tagged Image File Format (TIFF)
A VECTOR GRAPHICS
51
A. RESOLUTION
Vector graphics are resolution independent, they do not have a dpi and so is not high or
low resolution. The file size of vector graphics is usually very small compared to raster
graphics, this is because they do not carry the millions of individual pieces of pixel data
information that raster graphics have to hold.
B. SCALING
A Vector graphic can be scaled up to the size of a billboard or down to the size of a
business card all from the same file. Vector graphics are often produced by using object-
based editing software such as Illustrator.
CONVERSIONS
1. Vector to Raster: Printers and display devices are raster devices. As a result we need to
convert vector images to raster format before they can be used i.e displayed or printed.
The required resolution plays a vital role in determining the size of raster file generated.
Here it is important to note that the size of vector image to be converted always remains
the same. It is convenient to convert a vector file to a range of bitmap/raster file formats
but going down opposite path is harder (because at times we need to edit the image while
converting from raster to vector).
2. Raster to Vector: Image tracing in computing can be referred to vectorization and it’s
simply the conversion of raster images to vector images. An interesting application of
vectorization is to update images and recover work. Vectorization can be used to retrieve
52
information that we have lost. Paint in Microsoft Windows produces a bitmap output file.
It is easy to notice jagged lines in Paint. In this kind of a conversion the image size reduces
drastically. As a result an exact conversion is not possible in this scenario. Due to various
approximations and editing that is done in the process of conversion the converted images
are not of good quality.
53
MODULE SIX
GRAPHICS PACKAGES AND FACILITIES
A graphic package is a computer application that can be used to create and perform basic
operations on shapes and images.
Using graphics packages, you can create basic drawings, shapes, and images of different
degrees. The quality and kind of image or shape to be created depends on the kind of
package used.
Every computer graphic package has basic features that allow users to create and
manipulate shapes and images. Some of these features include pencil, eraser, paintbrush,
basic shapes, etc.
54
Another disadvantage of using a painting application package is that images cannot be
split into individual parts. A raster graphic image is a single image that cannot be
separated into individual units. This is the case when you convert a drawing into a bitmap
image in Coreldraw. To edit such an image, you will need Corel Photo-Paint because the
image cannot be separated again.
Vector or drawing graphics: A vector or drawing graphics package use paths, points,
lines, curves, and shapes or polygons to create images. This type of graphics packages is
based on mathematical equations. Here creative drawings are made from different
shapes, freehand drawings, and color additives. These individual parts can be brought
together or separated at will to create imaginative images.
Images made with vector graphics are expressions of one’s imagination. They are
expressions of one’s creative mindset. They may not look real but represents an idea,
philosophy, or brand.
One major advantage of vector graphics packages is that they retain their image quality
when images are altered. Hence, vector-based images can be scaled indefinitely without
degrading the image quality.
In other words, vector graphics are resolution-independent and thus can retain the highest
quality at any scale.
56
Features of CorelDraw
The features of CorelDRAW is similar to the features of most graphic design software.
Among the features are the:
57
Microsoft Paint Graphics Package
Microsoft Paint is a simple raster graphics program installed in all versions of the
Windows operating system. It can be used to scan images, create and modify objects.
It can open and save files in the following formats: Jpeg, Gif, PNG, TIFF, and bitmap
(.bmp). The bitmap file extension can be monochrome, 16 color, 256 color, and 24-Bit
bitmap. The diagram below displays the Windows 8.1 Paint environment.
(2) Drawing regular pre-defined shapes like squares, rectangles and circles using a
special ‘tool’.
(3) Entering text and changing the style and size of font.
58
(5) Rotating objects in either clockwise or anticlockwise by specifying the direction
and angle of rotation.
(7) A paint palette from which different colours and patterns can be chosen.
(8) A fill option for colouring in a shape or area on the screen with a colour or pattern
from the paint palette.
(10) Zoom or magnify is a feature that allows an area of the screen to be seen close up
for detailed work.
(11) Special brushes such as an airbrush can be used to achieve different paint effects
on the screen.
(12) Exporting is a special way of saving a file produced using a graphics package so
that it can be used in another application package.
(13) When an exported file is needed in another application it is opened in a special way
called importing.
CAD/ENGINEERING SOFTWARE
Computer Aided Design (CAD) and engineering software graphics packages contain the
necessary drafting tools required for making 2D and 3D drawings. These programs let
you generate graphics that meet industry-based standards. With the tools offered in these
kits, you are able to prepare drawings complete with geometric dimensions, surface
texture symbols, mechanical systems and weld symbols as needed.
With the ability to print in various forms, multiple users can utilize the designs for their
specific projects. This saves time, increasing productivity and generating more revenue
59
quicker. With the clarity of the designs produced, the user has more freedom to apply
new ideas in a faster time frame. Designs can be saved and retrieved later to use when
needed.
60