UNIT 12: INTRODUCTION TO COMPUTER GRAPHICS
Introductory Activity
Observe the picture below and answer the following questions:
1. Describe what you see.
2. Describe how the pictures inside are arranged.Are these pictures
created using the same material?
3. How can you measure the size of each picture?
4. Is it easy to modify these pictures? Explain.
5. Explain the areas where pictures are used.
6. Why is it important to have good pictures in business advertisement?
7. Nowadays, youth like posting their nakedness pictures on social media.
Discuss the inconvenience.
12.1 Definition of Computer graphics terms
Activity 12.1
By using different mobile phones, take pictures of the same group of students in
your classroom. After saving those pictures in one folder and observing carefully,
give the difference between them. Explain what could be the cause of that
difference.
12.1.1 Introduction
The human perception of the world is done through the five senses among which
the view is very important. Our brain recognizes the faces of people and the shapes
of things because they retain their pictures.
Currently, the use of computers has helped to digitalise the images and the work
of drawing became easier than before. Consequently, a new area of application
of computer science called computer graphics was born and hence pictures and
images are used in different areas of the human life for its development. Computer
Graphics involves the ways in which images can be displayed, manipulated and
stored using a computer. Computer graphics provides the software and hardware
techniques or methods for generating images.
12.1.2.Definition of different terms
Computer graphics can be defined in two ways depending on the circumstances:
Computer Graphics is an art of drawing pictures, lines, charts, etc, using computers
with the help of programming. Computer graphics are made up of number of pixels.
A pixel is the smallest graphical picture or unit represented on the computer screen.
or
Computer graphics are pictures and films created by using computers. Usually, the
term refers to computer-generated image data created with help from specialized
graphical hardware and software.
Computer graphics can be classified into two categories: Raster or Bitmap graphics
and Vector or Object-oriented graphics.
1. Raster (Bitmap) Graphics
These are pixel based graphics and the pixels can be modified individually.
• The images are easy to edit in memory and display on TV monitors owing to
the arrangement of the pixels in a rectangular array.
• The image size is determined on the basis of image resolution.
• These images cannot be scaled easily; resizing do not work very well and
can significantly distort the image.
• Bitmap graphics are used for general purpose images and in particular
photographs.
2. Vector (Object-oriented) Graphics
These graphics are mathematically based images.
• Vector based images have smooth edges and therefore used to store images
composed of lines, circles and polygons.
• These images can easily be re-scaled and rotated.
• They can not easily accommodate complex images such as photographs
where colour information varies from pixel to pixel.
• Vector graphics are well suited for graphs, e.g. in spreadsheets and for
scalable fonts, e.g. postscript fonts
3. A model of an object is a physical representation that shows what it
looks like or how it works. The model is often smaller than the object it
represents
4. The computer resolution is the number of pixels (individual points of
color) contained on a display monitor, expressed in terms of the number
of pixels on the horizontal axis and the number on the vertical axis.
5. A pixel is the smallest element of a picture that can be represented on
the screen of a device like a computer. Pixels per inch (PPI) or pixels per
centimeter (PPCM) are measurements of the pixel density (resolution)
of an electronic image device, such as a computer monitor or television
display, or image digitizing device such as a camera or image scanner.
6. 2D (2Dimensional) images are objects that are rendered visually on
paper, film or on screen in two planes representing width and height (X
and Y). Two-dimensional structures are also used in the construction of 3D
objects.
7. 3D computer graphics or three-dimensional computer graphics,
(in contrast to 2D computer graphics) are graphics that use a threedimensional representation of geometric data (often Cartesian) that is
stored in the computer for the purposes of performing calculations and
rendering 2D image.
8. A color scheme is the choice of colors used in design for a range of media.
For example, the use of a white background with black text is an example
of a basic and commonly default color scheme in writing.
9. 8-bit color graphics is a method of storing image information in a
computer’s memory or in an image file, such that each pixel is represented
by one (8-bit) byte. The maximum number of colors that can be displayed
at any one time is 28=256.
10. 16-bit color graphics also called High color is a method of storing
image information in a computer’s memory or in an image file where
computerand monitors can display as many as 216=65,536 colors,
which is adequate for most uses. Each pixel is represented by two
bytes i.e 16 bits, but some devices also support 15-bit high color.
However, graphic intensive video games and higher resolution video can
benefit from and take advantage of the higher color depths.
11. 32-bit color graphics is a method of storing image information in a
computer’s memory or in an image file where computer and monitors can
display as many as 232=4,294,967,296 colors, which is adequate for most
uses. Each pixel is represented by four (4) bytes i.e 32 bits.
a. Image compression
Image compression is minimizing the size in bytes of a graphic file without degrading
the quality of the image to an unacceptable level. The reduction in file size allows
more images to be stored in a given amount of disk or memory space. It also reduces
the time required for images to be sent over the Internet or downloaded from web
pages. Know an image’s file size and dimensions before or after uploading it into the
Library
b. Determination of an image’s file size and dimensions
The determination of an image’s file size and dimensions differs according to the
Operating System being used.
On MS Windows computers, Open the image in Windows Explorer to check
dimensions and file size by clicking the Windows Start button on the taskbar. After
opening the folder containing the image, right clicking the icon of the image file,
and in the pop up menu, click on property and details. The result will look like below.
The wanted information are circled with red line
c. Calculating size of an uncompressed image file
byte is a unit of storage in computing, and unfortunately, a byte isn’t big enough
to hold a pixel’s worth of information. It actually takes 2 to 3 bytes to store one pixel
of a color image.
So the pixels in the image store a color at a given point in the image, but it takes 2
to 3 bytes of storage to record this value. If we consider 3 bytes of storage, the file
size of a color image is: width * height * 3 = 36,636,672 which gives us the file size
in bytes.
But this is a big number, so we want to convert it to megabytes. There are 1,024
bytes in a kilobyte. There are 1,024 kilobytes in a megabyte. So the file size of a color
image in megabytes is: width * height * 3 / (1024 * 1024) = 34.9MB
d. Graphics file format/image file format:
Image file formats are standardized means of organizing and storing digital images.
Image files are composed of digital data in one of the formats that can be rasterized
for use on a computer display or printer. An image file format may store data in
uncompressed, compressed, or vector formats. Once rasterized, an image becomes
a grid of pixels, each of which has a number of bits to designate its color equal to the
color depth of the device displaying it.
There are 5 main formats in which to store images including TIFF, JPEG, GIF, PNG and
Raw image files. Their differences are given in the table below:
Application Activity 12.1.
1. Define an image.
2. Define vector graphics and raster graphics.
3. Define a pixel.
4. What is computer resolution?
5. How an image size is calculated?
6. Briefly describe two basic types of Graphics file formats.
7. List two categories of images in computer graphics.
8. In which graphic system are images easily scalable?
9. By using image taken with your camera or retrieved in your computer,
determine its size.
12.2 Images capturing tools
Activity 12.2
1. Describe what you see
2. What are the roles of the above devices?
3. Which device is most useful in our days in photo capturing? Why?
4. Describe the functioning of each device and describe the parts of each
12.2.1 Digital camera
a. Definition
A digital camera is a camera which produces digital images that can be stored in
a computer and displayed on screen.It records and stores photographic images in
digital format.
These stored images can be uploaded to a computer immediately or stored in the
camera to be uploaded into a computer or printer later.
Digital cameras use an image sensor instead of photographic film.
2. Digital camera parts
There are 10 basic camera parts to identify in today’s digital world. These parts will
inevitably be found on most cameras being digital compact or single-lens reflex
camera (SLR)
• Lens
The lens is one of the most vital parts of a camera. The light enters through the lens,
and this is where the photo process begins. Lenses can be either fixed permanently
to the body or interchangeable. They can also vary in focal length, aperture, and
other details.
• Viewfinder
The viewfinder can be found on all digital single-lens reflex cameras (DSLR) and some
models of digital compacts. On DSLRs, it will be the main visual source for imagetaking, but many of today’s digital compacts have replaced the typical viewfinder
with Liquid Crystal Display (LCD) screen.
• Body
The body is the main portion of the camera, and bodies can be a number of different
shapes and sizes. DSLRs tend to be larger bodied and a bit heavier, while there are
other consumer cameras that are a conveniently smaller size and even able to fit into
a pocket.
• Shutter Release
The shutter release button is the mechanism that “releases” the shutter and therefore
enables the ability to capture the image. The length of time the shutter is left open
or “exposed” is determined by the shutter speed.
• Aperture
The aperture affects the image’s exposure by changing the diameter of the lens
opening, which controls the amount of light reaching the image sensor. Some digital
compacts will have a fixed aperture lens, but most of today’s compact cameras have
at least a small aperture range.
• Image Sensor
The image sensor converts the optical image to an electronic signal, which is then
sent to the memory card. There are two main types of image sensors that are used
in most digital cameras: complementary metal-oxide-semi conductor (CMOS) and
charge-coupled device (CCD) Both forms of the sensor accomplish the same task,
but each has a different method of performance.
• Memory Card
The memory card stores all of the image information, and they range in size and
speed capacity.
• LCD Screen
The LCD screen is found on the back of the body and can vary in size. On digital
compact cameras, the LCD has typically begun to replace the viewfinder completely.
On DSLRs, the LCD is mainly for viewing photos after shooting, but some cameras do
have a “live mode” as well.
• Flash
The on-board flash will be available on all cameras except some professional grade
DSLRs. It can sometimes be useful to provide a bit of extra light during dim, low light
situations.
• User Controls
The controls on each camera will vary depending on the model and type. The
basic digital compacts may only have auto settings that can be used for different
environments, while a DSLR will have numerous controls for auto and manual
shooting along with custom settings.
Those parts can be seen on the following picture.
c. Importing pictures using USB cable
The images taken by using a camera are stored automatically in its memory. However,
for different purposes, the images can be printed or inserted in documents for
illustrations. The camera is then connected to the printer or the computer by using
a USB cable appropriately designed for such action. The fact of taking pictures from
the camera to the computer is called importing pictures.
The following steps are followed to successfully import a picture from camera to
computer by using a USB cable.
Step1
Connect one end of the USB cable to the port in your camera.
Step2
Connect the other end of the USB cable to the USB port in the computer. This may
be in the front or back of the computer.
Step3
Turn on the camera
Step4
A dialog box may appear on the screen. If it does, select “View Files” or “Open Folder.”
If the dialog does not appear, click the Windows “Start” menu, select “Computer” and
then choose the drive labeled for the connected camera.
Step5
The pictures are probably located in a particular photo folder on the camera. Open
that folder. Drag individual photos from the folder to the desktop or some other
folder on the computer. All the photos can be selected by pressing “Ctrl-A” and then
pasted into a folder on the computer by pressing “Ctrl-V.”
12.2.2 Scanner
a. Definition
A scanner is an electronic device which can capture images from physical items
(printed text, handwriting, photographic prints, posters, magazine pages, and
similar sources) and convert them into digital formats, which in turn can be stored in
a computer, and viewed or modified using software applications.
Very high resolution scanners are used for scanning for high-resolution printing, but
lower resolution scanners are adequate for capturing images for computer display.
b. The different parts of scanner
A scanner has the following five (5) parts visible externally:
(1)Start button, (2) Copy button, (3) Scan to E-mail button, (4) Scan to Web button,
(5) Scanner cover
Application Activity 12.2.
1. Compare digital camera to scanner? List the importance of digital
camera in computer graphic.
2. With your camera, take a picture of the school computers, import it in
your computer and insert it in one of your text documents created in
MS Word.
3. At your school, what are the advantages and disadvantages of keeping
scanned documents?
4. By using your scanner in computer laboratory, scan your student card
and insert it in one text document created in MS Word.
5. Give the names of the 3 scanner parts indicated in the following image.
Area of graphics use
Computer graphics can be applied in various areas. Examples are such as follows:
12.3 Computer-Aided Design
Activity 12.3
After visiting the school library take different books and magazines and answer
the following questions:
1. Describe how the books and magazines covers look.
2. What is importance of having attractive picture on first page of any
magazine?
3. Which ways can be used to advertise your school?
4. List other fields where the photo are important to use
In engineering and architectural systems, the products are modeled using computer
graphics commonly referred as CAD (Computer Aided Design). In many design
applications like automobiles, aircraft, spacecraft, etc., objects are modeled in a
wireframe outline that helps the designer to observe the overall shape and internal
features of the objects.
12.3.2 Computer Art:
A variety of computer methods are available for artists for designing and specifying
motions of an object. The object can be painted electronically on a graphic tablet
using stylus with different brush strokes, brush widths and colors. The artists can also
use combination of 3D modeling packages, texture mapping, drawing programs
and CAD software to paint and visualize any object.
12.3.3 Entertainment:
Computer graphics methods are widely used in making motion pictures, music
videos and television shows. Graphics objects can be combined with live actions or
can be used with image processing techniques to transform one object to another.
12.3.4 Education and training:
Computer graphics can make better the understanding of the functioning of a
system. In physical systems, biological systems, population trends, etc., models make
it easier to understand. In some training systems, graphical models with simulations
help a trainee to train in virtual reality environment. For example, practice session or
training of ship captains, aircraft pilots, air traffic control personnel.
12.3.5 Image processing:
Image processing provides techniques to modify or interpret existing images. One
can improve picture quality through image processing techniques. For instance,
in medical applications, image processing techniques can be applied for image
enhancements and is been widely used for CT (Computer X-ray Tomography) and
PET (Position Emission Tomography) images.
12.3.6 Graphical User Interface:
GUI is commonly used to make a software package more interactive. There are
multiple window systems, icons, menus, which allow a computer setup to be utilized
more efficiently.
a. Logo (abbreviation of logotype, from Greek: is a graphic mark, emblem,
or symbol used to aid and promote public recognition. It may be of an
abstract or figurative design or include the text of the name it represents
as in a logotype or wordmark.
b. Advertising is communicated through various mass
media, including traditional media such as newspapers,
magazines, television, radio, outdoor advertising or direct mail; and new
media such as search results, blogs, social media, websites or text
messages. The actual presentation of the message in a medium is referred
to as an advertisement
c. An illustration is a decoration, interpretation or visual explanation of a
text, concept or process, designed for integration in published media,
such as posters, flyers, magazines, books, teaching materials, animations,
video games and films.
d. A magazine is a publication, usually a periodical publication, which is
printed or electronically published (sometimes referred to as an online
magazine). Magazines are generally published on a regular schedule and
contain a variety of content.
Conclusion
Computer Graphics involves ways in which images can be displayed, manipulated
and stored using computers. Computer graphics images can be categorised into
raster graphics, which as pixel-based graphics, and vector graphics, which are
mathematically represented. Computer graphics is applicable in various areas such
as computer-aided design, computer art, entertainment, as well as in education and
training.
Application Activity 12.3.
5. Why is it important to use graphics in advertisement?
6. In Rwanda, how computer graphics is used in entertainment?
7. How your school logo is designed? Explain how can you modify it using
computer graphic
8. Differentiate computer art to computer aid design
9. Discuss how computer graphics is used in entertainment in our country
12.4 Graphics software, features and editing tools
Activity 12.4
1. Describe what you see on the pictures below
2. How is it the appearance of those pictures?
3. In which way a picture can be modified?
4. Which tools can you use to modify or to create a picture?
12.4.1 Graphic softwares
Computer graphics is mostly mastered by practicing; such as by writing and testing
programs that produce a variety of pictures. An environment that allows one to
write and execute programs is required. The environment should generally include
hardware for display of pictures, and software tools that written programs can use
to perform the actual drawing of pictures. This part presents the commonly used
software for producing graphics.
a. Microsoft Paint
Microsoft Paint or ‘MS Paint’ is a basic graphics/painting utility that is included in
all the Microsoft Windows versions. MS Paint can be used to draw, colour and edit
pictures, including imported pictures from a digital camera for example. MS Paint is
found in the windows start menu within the Accessories Folder.
The primary features of MS Paint are simple drawing tools that you can use to easily
draw on a blank canvas or existing image. Beyond that, Paint includes cropping,
resizing, rotating, skewing, and selection tools to further.
b. Microsoft Office Picture Manager
Microsoft Office Picture Manager (code named Microsoft Picture Library) is a raster
graphics editor introduced in Microsoft Office 2003 and included up to Office 2010.
The Basic image editing features include colour correct, crop, resize, and rotate.
With Microsoft Office Picture Manager, you can manage, edit, share, and view your
pictures from where you store them on your computer. There are picture editing
tools to crop, expand, or copy and paste.
Microsoft Office Picture Manager allows easily managing and editing. Picture
Manager is used to adjust the brightness and contrast of an image.
c. Adobe Photoshop
Adobe Photoshop is a raster graphics editor developed and published by Adobe
Systems for MacOS and Windows.
Adobe Photoshop is the predominant photo editing and manipulation software on
the market. Its uses range from full featured editing of large batches of photos to
creating intricate digital paintings and drawings that mimic those done by hand.
12.4.2 Graphic features
12.4.2.1 Definition
Graphic features are pictures and other images that accompany a piece of text to
improve its meaning for the reader. Some examples of graphic features include
photographs, drawing, maps, charts and diagrams. While graphic features may
sometimes be purely decorative, they are more often used to make the meaning of
a text clearer.
12.4.3 Graphic editing tools
a. Tools in MS-Paint
Starting the Microsoft Paint program in Windows
1. Choose Start->All Programs->Accessories->Paint.
c. Tools in Ms Office picture manager
Step1.
Starting the Microsoft office picture manager
Microsoft Office comes with its own Picture Manager. You can open the Picture
Manager by clicking Start, choosing All Programs (or Programs), choosing the
Microsoft Office folder, choosing Microsoft Office Tools, and clicking Microsoft
Picture Manager.
Step2.
Using Picture Manager editing tools for adjustment:
• Brightness and contrast: Select the brightness and contrast menu entry.
The task pane will display a range of control sliders; you can use these to
adjust any exposure issues (too bright, too dark etc).
• Color: Select the Color option from the Edit Pictures menu. Use the sliders
to adjust the Hue and Saturation.
• Crop: Select the Crop option. You will notice the crop is previewed on the
image; you can click and drag the crop area to reposition it. Grab the little
black crop marks in the corners or on the edges to scale the image.
Red-eye removal: Select Red eye removal from the Edit Pictures menu.
Click the mouse curser several times over all the red eye areas you want to
remove, and then click OK.
Resize your picture: On the Edit Pictures menu select Re-size to display the
resize.
Choose the Predefined setting of Document – Small (800 x 600), this is perfect for
working in Word without slowing it down. This will also reduce the size of the file,
perfect if you intend on emailing the document as an attachment.
After editing a picture, you can either File > Save to save the photo in its modified
format, or File > Save As… to give it a new filename (allowing you to keep the original
source file intact).
1. Photoshop editing tools
To change the image size, go through these steps:
Start->photoshop->File->open (choose an image where it is stored)->image
(in menu bar)
->image size->fill the new width and height in pixel dimension->ok
For this exercice, consider the image below which is with its original dimensions:
In Photoshop, Adobe introduced the Color Picker to make the selection of a color
even easier. (To access the Color Picker with a painting tool selected, click anywhere
in the image area and drag to select a color.
Magic wand
The Magic Wand Tool, known simply as the Magic Wand, is one of the oldest selection
tools in Photoshop. Unlike other selection tools that select pixels in an image based
on shapes or by detecting object edges, the Magic Wand selects pixels based color
Eraser
An eraser is an article of stationery that is used for removing writing from paper or
skin. Erasers have a rubbery consistency and come in a variety of shapes, sizes and
colours.
Gradient tool
A gradient is a set of colors arranged in a linear order, sometimes known as the
“gradienttool” or “gradient fill tool”: it works by filling the selection with colors
from a gradient.
Paint bucket
The paint bucket tool generally comes along with image editing software. What
it does is fill an area on the image with a selected color. The tool usually fills to the
boundaries of a solid color. As an example if you have a black box and apply red with
the paint bucket tool it will convert the entire box to red.
Smudge
The smudge tool is used to smear paint on your canvas. The effect is much like
finger painting. You can use the smudge tool by clicking on the smudge icon and
clicking on the canvas and while holding the mouse button down, dragging in the
direction you want to smudge.
Clone stamp tool
Clone stamp is used in digital image editing to replace information for one part of
a picture with information from another part. In other image editing software, its
equivalent is sometimes called a clone brush.
Shape
A shape is the form of an object or its external boundary, outline, or external surface,
as opposed to other properties such as color, texture or material composition
Rectangle: is a quadrilateral with four right angles a plane figure with four straight
sides and four right angles, especially one with unequal adjacent sides, in contrast
to a square
Lasso tool: it is used to create a selection area within or around a particular object.
The difference is that it allows the user to more easily select along individual short
paths on difficult object limit where the tool can’t be used
Polygon lasso
The Polygonal Lasso Tool is hiding behind the standard Lasso Tool in the Tools
panel. Once you’ve selected the Polygonal Lasso Tool, it will appear in place of the
standard Lasso Tool in the Tools panel.
Rotate
This tool is used to rotate the active layer, a selection or a path. When you click on
the image or the selection with this tool, a grid or an outline is superimposed and a
rotation information dialog is opened. There, you can set the rotation axis, marked
with a point, and the rotation angle.
Application Activity 12.4.
1. What is the importance of Ms Paint in computer graphics?
2. Differentiate Photoshop from MS office picture manager
3. Discuss the use of Ms Office picture manager in graphics
4. Differentiate Paint from Photoshop
5. What is the use of Lasso tool in Photoshop
6. Distinguish image size to canvas size
7. What is the use of Gradient Tool?
12.5 Basic Graphic elements
Activity 12.5
Observe the picture above and answer the following questions:
1. Describe what you see on the picture
2. What are the elements which make this picture?
3. how can you put different parts of this image
12.5.1 Graphic elements
Graphic elements are the simplest building blocks of graphics. Just as bricks are the
basic elements of a building, graphic elements are used to create graphics.
12.5.2 Basic graphic element types
The basic graphic elements are the following:
Line is probably the most fundamental of all the elements of design. A more usable
definition might be that line is the path of a dot, point etc. through space and that
is always has more length than thickness. Lines are not all the same, especially in art
A brush is a tool with bristles, wire or other filaments, used for cleaning, grooming
hair, make up, painting, surface finishing and for many other purposes.
Polyline
A polyline is a connected sequence of straight lines. To the eye, a polyline can appear
as a smooth curve. Simple polyline attributes are colour and thickness. The simplest
polyline is a single straight line segment. A line segment is specified by its two
endpoints, such as (x1, y1) and (x2, y2). When there are several lines in a polyline,
each one is called an edge, and two adjacent lines meet at a vertex.
The edges of a polyline can cross one another but a polyline does not have to be
closed. A polygon has its first and last points connected by an edge. If no two edges
cross, the polygon is called a simple polygon. An example of a polyline is shown in
figure 12.60 and a polygon is shown in figure 12.61
The polygon element defines a closed shape consisting of a set of connected straight
line segments. The last point is connected to the first point.
Text
Some graphics devices have two distinct display modes: text mode and graphics
mode. In text mode, text is generated using a built-in character generator. Text in
graphics mode is drawn. Text attributes are such as colour, size, font, spacing and
orientation.
Filled Regions
A filled region is a shape filled with some colour or pattern. An example is a filled
polygon as shown in figure.
Application Activity 12.5.
1. Describe the graphic element?
2. Describe basic elements in computer graphics
3. Differentiate an oval to a circle
4. Describe the use of brush in computer graphic?
END UNIT ASSESSMENT
A. Written assessment
Define the following terms:
• Brush
• Shape
• Lasso tool
• Bitmap
• Advertisement
1. Match the following tools in column A with their corresponding use in
2. What is polygon? Give an example
3. Explain the importance of computer graphic in decoration service
4. Write in full words the following abbreviation and explain them:
JPEG - TIFF - PNG
5. Distinguish 8-bit colour to high colour graphics
6. What is the use of USB port on digital camera
7. Differentiate 2D image to 3D image
8. Discuss the difference between Ms Paint and Adobe Photoshop
9. In Rwanda, computer graphics are used in advertising and entertainment.
Discuss
B. Practical work
Create a simple image using some of the drawing tools in Paint(Pencil, brush and shapes)
a. Selecting and moving parts of an image
b. Selecting and copying parts of an image
c. Save the image in JPG format
d. Copy that image in a word document
1. Using Adobe Photoshop, draw a ball as shown bellow
2. Create a line, polygon and a square using Paint. Make the shape outlines
coloured and filled with effects where possible. Save the file as SHAPES
3. Take a picture of yourself using a digital camera and edit the photo in
a way you wish using various tools on the toolbox and menu. In case
of absence of camera, use any available photo on your computer and
perform editing functioning to crop, resize, rotate and change the light of
the picture.