Gv101 Module 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 33

PAMPANGA

STATE
AGRICULTURAL
UNIVERSITY

Graphics
and
Visual
Computing
GV101

1
JOMAR S. BARICANTE
CREAM - DCSA
GV101 (Graphics and Visual Computation)
Course Description:
This course from CMO 25 series of 2015 is a recommended elective that provides detailed
study of computer graphics, 2 D and 3 D transformations, representations, and visualization. This
course aims to introduce and study the various techniques used to model 2D and 3D objects and
environments and to present its important aspects and it can be easily visualized such as photo realistic
rendering of 2D, 3D scenes and animation.
Number of Units/Credit: 3 Units (3 hours Laboratory and 2 hours Lecture per week)

PSAU Vision, Mission, Core Values, and Outcomes

PSAU VISION:
To be the Premier Science and Agro-ecological University

PSAU MISSION:
Mainstream science and practice of agroecological and industrial technologies through distinctive
instruction, research, extension and entrepreneurship for people and nature

PSAU GOAL:
To transform PSAU into an effective institution of higher learning for agroecological education and allied
fields, impact driven research, extension and entrepreneurship uplifting the welfare of the people and
nature

PSAU CORE VALUES:


People-centeredness – Relevant and socially-responsive services
Systems thinking – Integrated, collaborative, and multi-disciplinary approach to local and global issues
and concerns
Accountability – Responsibility, trustworthiness, and efficiency in implementing programs
Unity – Solidarity, teamwork, and harmony under the Almighty

2
Week 1 | Module 1
Fundamentals of Computer Graphics
At the end of this module you are expected to:
1. Define Computer Graphics
2. Be Informed about the History of Computer Graphics
3. Understand the significance of Computer Graphics in our daily living
4. Be knowledgeable about the fundamentals of Computer Graphics in computer software and hardware

1.1 Introduction to Computer Graphics

Computer Graphics involves technology to access. The Process transforms and presents information
in a visual form. The role of computer graphics insensible. In today life, computer graphics has
now become a common element in user interfaces, T.V. commercial motion pictures. In computer
graphics, two or three-dimensional pictures can be created that are used for research. Many
hardware devices algorithm has been developing for improving the speed of picture generation with the
passes of time. It includes the creation storage of models and image of objects. These models for
various fields like engineering, mathematical and so on.

Today computer graphics is entirely different from the earlier one. It is not possible. It is an interactive
user can control the structure of an object of various input devices.

What is Computer Graphics?


Computer Graphics is the creation of pictures with the help of a computer. The product of the
computer graphics is a picture it may be a business graph, drawing, and engineering. It is the use of
computers to create and manipulate pictures on a display device. It comprises of software techniques to
create, store, modify, represents pictures.
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. - tutorialspoint.com
Computer graphics: generating 2D images of a 3D world represented in a computer.
Main tasks:
1. Modeling: creating and representing the geometry of objects in the 3D world
2. Rendering: generating 2D images of the objects
3. Animation: describing how objects change in time
It involves how pictures are represented in computer graphics, how pictures are prepared for
presentation, how interaction within the picture is accomplished.

3
Why computer graphics is important?
Suppose a shoe manufacturing company want to show the sale of shoes for five years. For this vast
amount of information is to store. So, a lot of time and memory will be needed. This method will be tough
to understand by a common man. In this situation graphics is a better alternative. Graphics tools are
charts and graphs. Using graphs, data can be represented in pictorial form. A picture can be
understood easily just with a single look.

Figure 1. Computer Graphics

Interactive computer graphics work using the concept of two-way communication between
computer users. The computer will receive signals from the input device, and the picture is
modified accordingly. Picture will be changed quickly when we apply command. One of the most
important issue when selling a product is its design, when a customer purchase product, they base their
choice on the packaging rather than the contents. Psychologically speaking, attractive images
immediately convey the notion of high-quality contents.
We can see examples of this concept everywhere: think of the car industry, where aesthetics is
paramount, or the enormous interest that novel cell phone or tablet designs can generate. In the movie
industry, films with computer graphics and realistic 3D-effects often dominate the box office. The same
notion goes for software, where an embellished interface, proper menu arrangement and up-to-
date graphics and effects are all critical components of the overall user experience, and often form the
deciding factors for one package over another.

Computer Graphics Applications


Computer Graphics has numerous applications, some of which are listed below
1. Computer Graphics User Interfaces GUI’s: are graphic, mouse-oriented paradigm which allows
the user to interact with a computer.
2. Business presentation graphics: "A picture is worth a thousand words".
3. Cartography: Drawing maps.
4. Weather Maps: Real-time mapping, symbolic representations.
5. Satellite Imaging: Geodesic images.
6. Photo Enhancement: Sharpening blurred photos.
7. Medical imaging: MRIs, CAT scans, etc. Non-invasive internal examination.
8. Engineering drawings: mechanical, electrical, civil, etc. Replacing the blueprints of the past.
9. Typography: The use of character images in publishing Replacing the hard type of the past.
10.Architecture: Construction plans, exterior sketches, Replacing the blueprints and hand drawings of
the past.
4
11.Art: Computers provide a new medium for artists.
12.Training: Flight simulators, computer aided instruction, etc.
13.Entertainment: Movies and games.
14.Simulation and modeling: Replacing physical modeling and enactments

Graphics Applications

Figure 2. Computer Graphics in Entertainment

Graphics Application in everyday use

Figure 3. Computer Graphics in Scientific Visualization

5
Figure 4. Computer Graphics in Training

Figure 5. Computer Graphics in Computer Aided Design CAD

Figure 6. Computer Graphics in Games

6
1.2 History of Computer Graphics
Early 60's:
• Computer animations for physical simulation; Edward
Zajac displays satellite research using CG in 1961
• 1963: Sutherland (MIT)
Sketchpad (direct manipulation, CAD)
Calligraphics (vector) display devices
Interactive techniques
First mouse (Douglas Englebart)
• 1968: Evans & Sutherland founded
• 1969: First SIGGRAPH
Late 60's to late 70's:
Utah Dynasty
• 1970: Pierre Bezier develops Bezier curves
• 1971: Gouraud Shading
• 1972: Pong (first computer game) developed
• 1973: Westworld, the first film to use computer
animation
• 1974: Ed Catmull develops z-buffer (Utah)
First Computer Animated Short, Hunger. Keyframe
animation and morphing.
• 1975: Bui-Toung Phong creates Phong Shading (Utah)
Martin Newel models a 3D teapot with Bezier
patches (Utah)

Mid 70's -80's:


• Quest for realism. Radiosity shading; mainstream
real-time applications.
• 1982: Tron, Wrath of Kahn. Particle systems and
obvious CG.
• 1984: The Last Star Figher, CG replaces
physical models. Early attempts at realism using CG.
• 1986: First CG animation nominated for and Academy
Award: Luxo Jr. (Pixar)
• 1989: Tin Toy (Pixar) wins Academy Award.
• 1995: Toy Story (Pixar/Disney), the first full length
fully computer-generated 3D animation. The first fully
3D CG cartoon Babylon 5. First TV show routinely
using CG models.

7
Late 90's:

• Interactive environments, scientific and medical visualization, artistic rendering, image-based


rendering, path tracing, photon maps, etc.

Figure 7. Interactive environments, scientific and medical visualization


In 2000's:
Real-time photorealistic rendering on consumer HW?
Interactively rendered movies.
Ubiquitous computing, computer vision and graphics.

Figure 8. Virtual and Augmented Reality in Education

8
1.3 Computer Graphics Systems
A computer graphics system is a computer system; as such, it must have all the components of a
general-purpose computer system. Let us start with the high-level view of a graphics system, as shown
in the block diagram in figure below. There are six major elements in our system:
1. Input devices
2. Central Processing Unit
3. Graphics Processing Unit
4. Memory
5. Frame buffer
6. Output devices

BASIC GRAPHICS SYSTEM

IMAGE FORM IN OUTPUT DEVICES


INPUT DEVICES
FRAME BUFFER
Figure 9. Basic Graphics System

This model is general enough to include workstations and personal computers, interactive game
systems, mobile phones, GPS systems, and sophisticated image generation systems. Although most of
the components are present in a standard computer, it is the way each element is specialized for
computer graphics that characterizes this diagram as a portrait of a graphics system.

Display (Video Display Device)


Most popular:

9
LCD (Liquid Crystal Display)
It is a type of flat panel display
which uses liquid crystals in its primary
form of operation. LCDs have a
large and varying set of use cases for
consumers and businesses, as
they can be commonly found in
smartphones, televisions, computer
monitors and instrument panels.

Other popular display types:


• CRT (Cathode Ray Tube)
• Plasma display
• Field Emission Displays
• Light Emitting Diodes

Figure 10. LCD (Liquid Crystal Display)

LED display, or Light Emitting Diode display


It is a flat panel display that uses light emitting diodes as the video display. An LED display panel can be
either a small display or part of a larger display. LED diodes are used to make up an LED display. LED
displays are also used in billboards and store signs.

• 3D display devices (hologram or page scan methods)

Figure 11. LED (Light Emitting Diode)

10
Cathode Ray Tubes (CRTs)
Inventor: Karl Ferdinand Braun

The cathode-ray tube (CRT) is a vacuum


tube that contains one or more electron guns
and a phosphorescent screen and is used to
display images. It modulates, accelerates, and
deflects electron beam(s) onto the screen to
create the images.

• Most common display device


• Evacuated glass bottle
• Extremely high voltage
• Heating element (filament)
• Electrons pulled towards
anode focusing cylinder
• Vertical and horizontal deflection plates
• Beam strikes phosphor coating on front of tube
Figure 12. CRT MONITOR

Figure 13. CRT (Cathode Ray Tube)

Components of CRT:
Main Components of CRT are:
1. Electron Gun: Electron gun consisting of a series of elements, primarily a heating filament (heater)
and a cathode. The electron gun creates a source of electrons which are focused into a narrow beam
directed at the face of the CRT.
11
2. Control Electrode: It is used to turn the electron beam on and off.
3. Focusing system: It is used to create a clear picture by focusing the electrons into a narrow beam.
4. Deflection Yoke: It is used to control the direction of the electron beam. It creates an
electric or magnetic field which will bend the electron beam as it passes through the area. In a
conventional CRT, the yoke is linked to a sweep or scan generator. The deflection yoke which is
connected to the sweep generator creates a fluctuating electric or magnetic potential.
5. Phosphorus-coated screen: The inside front surface of every CRT is coated with phosphors.
Phosphors glow when a high-energy electron beam hits them. Phosphorescence is the term
used to characterize the light given off by a phosphor after it has been exposed to an electron beam.

Random Scan and Raster Scan Display:


Random Scan Display:
Random Scan System uses an
electron beam which operates like a pencil
to create a line image on the CRT screen.
The picture is constructed out of a
sequence of straight-line segments.
Each line segment is drawn on the screen
by directing the beam to move from one
point on the screen to the next,
where its x & y coordinates define
each point. After drawing the picture. The
system cycles back to the first line and
design all the lines of the image
30 to 60 time each second. The process is
shown in figure 14: Figure 14. Random Scan System

Random-scan monitors are also known as vector displays or stroke-writing displays or calligraphic
displays.
Advantages:
• A CRT has the electron beam directed only to the parts of the screen where an image is to be
drawn.
• Produce smooth line drawings.
• High Resolution
Disadvantages:
• Random-Scan monitors cannot display realistic shades scenes.

Raster Scan Display:


A Raster Scan Display is based on intensity control of pixels in the form of a rectangular box
called Raster on the screen. Information of on and off pixels is stored in refresh buffer or Frame buffer.

12
Televisions in our house are based on Raster Scan Method. The raster scan system can store
information of each pixel position, so it is suitable for realistic display of objects. Raster Scan provides a
refresh rate of 60 to 80 frames per second.
Frame Buffer is also known as Raster or bit map. In Frame Buffer the positions are called picture
elements or pixels. Beam refreshing is of two types. First is horizontal retracing and second is vertical
retracing. When the beam starts from the top left corner and reaches the bottom right scale, it will again
return to the top left side called at vertical retrace. Then it will again more horizontally from top to bottom
call as horizontal retracing shown in fig:

Types of Scanning or travelling of beam


in Raster Scan
• Interlaced Scanning
• Non-Interlaced Scanning
In Interlaced scanning, each horizontal
line of the screen is traced from top to
bottom. Due to which fading of display of
object may occur. This problem can be
solved by Non-Interlaced scanning. In
this first odd numbered line are traced or
visited by an electron beam, then in the
next circle, even number of lines are
located.

Figure 15. Raster Scan Interlaced

For non-interlaced display refresh rate of 30 frames per second used. But it gives flickers. For interlaced
display refresh rate of 60 frames per second is used.
Advantages:
• Realistic image
• Million Different colors to be generated
• Shadow Scenes are
possible. Disadvantages:
• Low Resolution

13
• Expensive

Table 1. Differentiate between Random and Raster Scan Display:

Frame Buffers

A frame buffer may be thought of as computer memory organized


as a two-dimensional array with each (x,y) addressable
location corresponding to one pixel.
Bit Planes or Bit Depth is the number of bits corresponding to
each pixel.
A typical frame buffer resolution might be
▪ 640 x 480 x 8
▪ 1280 x 1024 x 8
▪ 1280 x 1024 x 24
Monochrome Display (Bit-map Display)
The word "monochrome" literally
means "one color." Therefore, a monochrome
image only includes one color, but
may contain many shades. In
computing, "monochrome" typically refers to
a two-tone image, rather than one with
several shades of a single color. For
example, a monochrome monitor uses one
color for the background and another to
display text or images on the screen.

Figure 16. Monochrome Display


14
Bit Color Display

Figure 17. 3-Bit Color Display

Display Technology: Color CRTs

Color CRTs have

Three electron guns

A metal shadow mask to differentiate the beams

Figure 18. Color CRTs

15
Display Technology: DMD / DLP

Digital Micromirror Devices (projectors) or Digital Light Processing


Microelectromechanical (MEM) devices, fabricated with VLSI techniques
DMDs are truly digital pixels
Vary grey levels by modulating pulse length
Color: multiple chips, or color-wheel
Great resolution
Very bright
Flicker problems

Figure 19. (Digital Micromirror Devices) DMD or


(Digital Light Processing) DLP

Simple Raster Display System

Frame buffer: stored pixel map of screen


Video controller just refreshes the
frame buffer on the monitor periodically.
Inexpensive
Scan conversion of output primitives (lines,
rectangles etc.) done by the CPU. Slow.
As refresh cycle increases, memory cycles
used by the video controller increases.
Memory is less available to CPU.
Solution: Graphics Display Processor

Figure 20. Simple Raster Display System

16
Graphics Display Processor
It is interpreter or piece of hardware that converts display processor code into pictures. It is one of
the four main parts of the display processor
Parts of Display Processor
1. Display File Memory: It is used
for generation of the picture. It is
used for identification of graphic
entities.
2. Display Controller:
It handles interrupt, It maintains
timings and It is used for
interpretation of instruction.
3. Display Generator:
It is used for the generation of
character and It is used for the Figure 21. Block Diagram of Display System
generation of curves.
4. Display Console:
It contains CRT, Light Pen, and Keyboard and deflection system.
Input Devices
The Input Devices are the hardware that is used to transfer transfers input to the computer. The data
can be in the form of text, graphics, sound, and text. Output device display data from the memory of the
computer. Output can be text, numeric data, line, polygon, and other objects.

Figure 22. Computer Graphics System


Examples of Input Devices:
1. Keyboard
2. Mouse
3. Trackball
4. Spaceball
5. Joystick
6. Light Pen
7. Digitizer
8. Touch Panels
9. Voice Recognition
10.Image Scanner
17

17
Output Devices
Printer
Printer is the most important output device, which is used to print data on paper. It is an
electromechanical device, which accepts data from a computer and translates them into form
understand by users.
Following are Output Devices:
1. Printers
2. Plotters

Figure 23. Classification of Printers

1. Impact Printers: The printers that print the characters by striking against the ribbon and onto the
papers are known as Impact Printers.
These Printers are of two types:
• Character Printers
• Line Printers

2. Non-Impact Printers: The printers that print the characters without striking against the ribbon and
onto the papers are called Non-Impact Printers. These printers print a complete page at a time,
therefore, also known as Page Printers.
Page Printers are of two types:

18
• Laser Printers
• Inkjet Printers
Dot Matrix Printers:
Dot matrix has printed in the form of dots. A printer has a head
which contains nine pins. The nine pins are arranged one
below other. Each pin can be activated independently. All or
only the same needles are activated at a time. When needless
is not activated, and then the tip of needle stays in the head.
When pin work, it comes out of the print head. In nine pins
printer, pins are arranged in 5 * 7 matrixes.
Figure 24. Dot Matrix Printer

Daisy Wheel Printers:


This printer Head is lying on a wheel and Pins corresponding to
characters are like petals of Daisy, that is why called Daisy
wheel printer.

Drum Printers: Figure 25. Daisy Wheel Printer

These are line printers, which prints one line at a time. It consists
of a drum. The shape of the drum is cylindrical. The drum is solid
and has characters embossed on it in the form of vertical bands.
The characters are in circular form. Each band consists of some
characters. Each line on drum consists of 132 characters.
Because there are 96 lines so total characters are (132 * 95) = 12,
672. Drum contains several hammers also.

Chain Printers: Figure 26. Daisy Wheel Printer


These are called as line printers. These are used to
print one line at a line. Basically, chain consists of
links. Each link contains one character. Printers can
follow any character set style, i.e., 48, 64 or 96
characters. Printer consists of several hammers also.

Figure 27. Daisy Wheel Printer

19
Non-Impact Printers:
Inkjet Printers:
These printers use a special link called electrostatic ink. The printer
head has a special nozzle. Nozzle drops ink on paper. Head
contains up to 64 nozzles. The ink dropped is deflected by the
electrostatic plate. The plate is fixed outside the nozzle. The
deflected ink settles on paper.
0 Figure 28. Inkjet Printer
Laser Printers:
These are non-impact page printers. They use laser lights to
produces the dots needed to form the characters to be printed on a
page & hence the name laser printers.

Plotters
Plotters are a special type of output device. Figure 29. Laser Printer
• It can produce high-quality output on large sheets.
• It is used to provide the high precision drawing.
• It can produce graphics of various sizes.
The speed of producing output is high.
It is suitable for applications:
• Architectural plan of the building.
• CAD applications like the design of mechanical
components of aircraft.
Figure 30. Plotter
• Many engineering applications.
Drum Plotter:
It consists of a drum. Paper on which design is made is kept
on the drum. The drum can rotate in both directions. Plotters
comprised of one or more pen and penholders. The holders
are mounted perpendicular to drum surface. The pens are kept
in the holder, which can move left to the right as well as right to
the left. The graph plotting program controls the movement of
pen and drum.

Figure 31. Drum Plotter

20
Flatbed Plotter:
It is used to draw complex design and graphs, charts.
The Flatbed plotter can be kept over the table. The plotter
consists of pen and holder. The pen can draw characters
of various sizes. There can be one or more pens and pen
holding mechanism. Each pen has ink of different color.
Different colors help to produce multicolor design of
document. The area of plotting is also variable. It can
vary A4 to 21'*52'. It is used to draw:
• Cars
• Ships
• Airplanes
• Shoe and dress designing
• Road and highway design Figure 32. Flatbed Plotte

1.4 Computer Graphics Software


There are two types of Graphics Software.
1. General Purpose Packages: 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.
Example of general-purpose package is the GL (Graphics Library), GKS, PHIGS, PHIGS+
etc.
2. Special Purpose Packages: These packages are designed for non-programmers, so that these
users can use the graphics packages, without knowing the inner details.
Example of special purpose package is
1. Painting programs
2. Package used for business purpose
3. Package used for medical systems.
4. CAD packages

Algorithms
Several basic algorithms are needed:
1. Transformation: Convert representations of models/primitives from one coordinate system to
another
2. Clipping/Hidden surface removal: remove primitives and part of primitives that are not visible on
the display
3. Rasterization: Convert a projected screen space primitive to a set of
pixels. Advanced algorithms: 21
Picking: select a 3D object by clicking an input device over a pixel location.

Shading and illumination: Simulate the interaction of light with a scene.

Animation: Simulate movement by rendering a sequence of frames.

Application Programming Interfaces

Adobe Photoshop: 2D rasterization


Postscript, PDF: 2D transformations, 2D rasterization
Phigs+, GL, OpenGL Blender, WebGL, Direct3D: 3D pipeline
APIs provide access to rendering hardware via conceptual model.
APIs abstract the hardware implementations and algorithms in standard software calls.
For 3D interactive applications, we might modify the scene or a model directly or just the change
the attributes like viewing information.
We need to interface to input devices in an event-driven, asynchronous and device
independent fashion. APIs and toolkits are also defined for this task. GLUT, Qt, GTK, MFC,
DirectX, Motif, Tcl/Tk.

Figure 33. Graphics


Rendering

Graphics Rendering Pipeline

Rendering: conversion from scene to image


Scene is represented as a model composed of primitives. Model is generated by a program or
input by a user.
Image is drawn on an output device: monitor, printer, memory, file, video frame. Device
independence.
Typically rendering process is divided into steps called the graphics pipeline.
Some steps are implemented by graphics hardware.
Programmable graphics accelerator, GPU: programmable pipelines in graphics hardware

1.5 Modern Computer Graphics


The field of computer graphics developed with the emergence of computer graphics hardware.
Today computer graphics is use in almost every field. Many powerful tools have been developed to
visualize data. Computer graphics field become more popular when companies started using it in
video games. Today it is a multibillion-dollar industry and main driving force behind the computer
graphics development. Some common applications 22 areas are as following:
1. Computer Aided Design (CAD)
2. Presentation Graphics
3. 3d Animation
4. Education and training
5. Graphical User Interfaces
Computer Aided Design
• Used in design of buildings, automobiles, aircraft, and many other product
• Use to make virtual reality
system. Presentation Graphics
• Commonly used to summarize financial, statistical data
• Use to generate slides
3d Animation
• Used heavily in the movie industry by companies such as Pixar, Dreamworks
• To add special effects in games and
movies. Education and training
• Computer generated models of physical systems
• Medical Visualization
• 3D MRI
• Dental and bone scans
• Stimulators for training of pilots etc.
Graphical User Interfaces is used to make graphical user interfaces objects like buttons, icons, and
other components
Computer vision is the construction of explicit, meaningful descriptions of physical objects
from their image. The output of computer vision is a description or an interpretation of structures in
3D scene.
Example Applications
1. Robotics
2. Medicine
3. Security
4. Transportation
5. Industrial Automation
Robotics Application
• Localization-determine robot location automatically
• Navigation
• Obstacles avoidance
• Assembly (peg-in-hole, welding, painting)
• Manipulation (e.g. PUMA robot manipulator)
• Human Robot Interaction (HRI): Intelligent robotics to interact with and serve people
Medicine Application
• Classification and detection (e.g. lesion or cells classification and tumor detection)
• 2D/3D segmentation 23
• 3D human organ reconstruction (MRI or ultrasound)
• Vision-guided robotics surgery
Industrial Automation
Application
• Industrial inspection (defect detection)
• Assembly
• Barcode and package label reading
• Object sorting
• Document understanding (e.g.
OCR) Security Application
• Biometrics (iris, fingerprint, face recognition)
• Surveillance-detecting certain suspicious activities or behaviors
Transportation
Application
• Autonomous vehicle
• Safety, e.g., driver vigilance monitoring

1.6 Digital Image


Digital image is an image composed of picture elements, also known as pixels, each with finite,
discrete quantities of numeric representation for its intensity or gray level that is an output from its
two-dimensional functions fed as input by its spatial coordinates denoted with x, y on the x-axis and y-
axis, respectively.

There are 5 main digital image formats:


1. TIFF (also known as TIF), file types ending in .tif
TIFF stands for Tagged Image File Format. TIFF images create very large file sizes. TIFF images are
uncompressed and thus contain a lot of detailed image data (which is why the files are so big) TIFFs
are also extremely flexible in terms of color (they can be grayscale, or CMYK for print, or RGB for
web) and content (layers, image tags).
TIFF is the most common file type used in photo software (such as Photoshop), as well as page
layout software (such as Quark and InDesign), again because a TIFF contains a lot of image data.

2. JPEG (also known as JPG), file types ending in .jpg


JPEG stands for Joint Photographic Experts Group, which created this standard for this type of
image formatting. JPEG files are images that have been compressed to store a lot of information in a
small-size file. Most digital cameras store photos in JPEG format, because then you can take more
photos on one camera card than you can with other formats.
JPEG is compressed in a way that loses some of the image detail during the compression to
24
make the file small (and thus called “lossy” compression).
JPEG files are usually used for photographs on the web, because they create a small file that is
easily loaded on a web page and looks good.
JPEG files are bad for line drawings or logos or graphics, as the compression makes them look
“bitmappy”
(jagged lines instead of straight
ones).
3. GIF, file types ending in .gif
GIF stands for Graphic Interchange Format. This format compresses images but, as different from
JPEG, the compression is lossless (no detail is lost in the compression, but the file can’t be made as
small as a JPEG).
GIFs also have an extremely limited color range suitable for the web but not for printing. This format is
never used for photography, because of the limited number of colors. GIFs can also be used
for animations.
4. PNG, file types ending in .png
PNG stands for Portable Network Graphics. It was created as an open format to replace GIF,
because the patent for GIF was owned by one company and nobody else wanted to pay licensing
fees. It also allows for a full range of color and better compression.
It’s used almost exclusively for web images, never for print images. For photographs, PNG is not as
good as JPEG, because it creates a larger file. But for images with some text, or line art, it’s better,
because the images look less “bitmappy.”
When you take a screenshot on your Mac, the resulting image is a PNG–probably because
most screenshots are a mix of images and text.
5. Raw image files
Raw image files contain data from a digital camera (usually). The files are called raw because they
have not been processed and therefore cannot be edited or printed yet. There are a lot of different
raw formats– each camera company often has its own proprietary format.
Raw files usually contain a vast amount of data that is uncompressed. Because of this, the size of a
raw file is extremely large. Usually they are converted to TIFF before editing and color-correcting.
What is Image?
An image is nothing more than a two-dimensional signal. It is defined by
the mathematical function f(x,y) where x and y are the two co-ordinates
horizontally and vertically.
The value of f(x,y) at any point is gives the pixel value at that point of an
image. The above figure is an example of digital image that you are now
viewing on
your computer screen. But, this image is nothing but a two-dimensional
array of numbers ranging between 0 and 255.

25
Table 2. Two-dimensional array of numbers ranging between 0 and 255.

128 30 123

232 123 321

123 77 89

80 255 255

Each number represents the value of the function f(x,y) at any point. In this case the value 128, 230
,123 each represents an individual pixel value. The dimensions of the picture are the dimensions of
this two- dimensional array.

Computer graphics deals with the formation of images from object models, rather than the
image is captured by some device. For example: Object rendering. Generating an image from an
object model. Such a system would look something like this.

Figure 34. Graphics


Rendering

Image Processing
Digital image processing deals with manipulation of digital images through a digital computer. It
is a subfield of signals and systems but focus, particularly on images. DIP focuses on developing a
computer system that can perform processing on an image. The input of that system is a digital
image and the system process that image using efficient algorithms and gives an image as an output.
The most common example is Adobe Photoshop. It is one of the widely used application for
processing digital images.

26
Figure 35. Image Processing

In figure 35 shows an image has been captured by a camera and has been sent to a digital
system to remove all the other details, and just focus on the water drop by zooming it in such a way
that the quality of the image remains the same.
Analog image processing vs Digital image processing
Analog image processing is done on analog signals. It includes processing on two dimensional
analog signals. In this type of processing, the images are manipulated by electrical means by varying
the electrical signal. The common example include is the television image.
Digital image processing has dominated over analog image processing with the passage of
time due its wider range of applications. The digital image processing deals with developing a digital
system that performs operations on a digital image.

1.7 Raster Graphics vs Vector Graphics


Before we begin with what vector graphics and raster graphics are, we must understand a few
basic terms: Pixel: In Computer graphics a pixel, dots, or picture element is a physical point in a
picture. A pixel is simply the smallest addressable element of a picture represented on a
screen. While Bitmap: In computer graphics, a bitmap is a mapping from some domain (for
example, a range of integers) to bits, that is, values which are zero or one. It is also called a bit array
or bitmap index. The more general term pixmap refers to a map of pixels, where each one may store
more than two colors, thus using more than one bit per pixel. Often bitmap is used for this as well. In
some contexts, the term bitmap implies one bit per pixel, while pixmap is used for images with
multiple bits per pixel.
Majority of pictures that we see on our computer screen are raster images. The selfie that you
click with your mobile phone is another example of a raster image. An image is made up using a
collection of pixels referred to as a bitmap.

Raster Graphics
Raster images use bit maps to store information. This means a large file needs a large bitmap.
The larger the image, the more disk space the image file will take up. As an example, a 640 x 480
image requires information to be stored for 307,200 pixels, while a 3072 x 2048 image (from a 6.3
Megapixel digital camera) needs to store information for a whopping 6,291,456 pixels. We use
algorithms which compress images to help reduce these file sizes. Image formats like jpeg and gif
are common compressed image formats. Scaling down these images is easy but enlarging a bitmap
makes it pixelated or simply blurred. Hence for images which need to scale to different sizes, we use
vector graphics. 27
File extensions: .BMP, .TIF, .GIF, .JPG
Vector Graphics
Making use of sequential commands or mathematical statements or programs which place
lines or shapes in a 2-D or 3-D environment is referred to as Vector Graphics. Vector graphics are
best for printing since it is composed of a series of mathematical curves. As a result, vector graphics
print crisply even when they are enlarged. In physics: A vector is something which has a magnitude
and direction. In vector graphics, the file is created and saved as a sequence of vector statements.
Rather than having a bit in the file for each bit of line drawing we use commands which describe
series of points to be connected.
AS a result, a much smaller file is obtained. File extensions:
.SVG, .EPS, .PDF, .AI, .DXF

Differences between Vector and Raster graphics


The main difference between vector and raster graphics is that raster graphics are composed of
pixels, while vector graphics are composed of paths. A raster graphic, such as a gif or jpeg, is an
array of pixels of various colors, which together form an image.
Table 3. Differences between Vector and Raster graphics

28
Guide Questions 1
Answer the following to check what you have learned from the discussion so far. Check
your answer from the provided answer key at the end of this unit.
1. What is Computer Graphics?
2. What are the three main tasks of Computer Graphics?
3. What are the parts of display processor?
4. What are the two classification of printers?
5. What is the main difference between Vector and Raster graphics?

Answers to the Guide Questions 1

Question 1: Computer Graphics is the creation of pictures with the help of a computer. It 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.
Question 2: The three main tasks of Computer Graphics are the
following
1. modeling: it is the creating and representing the geometry of objects in the 3D world
2. rendering: it is the generating 2D images of the objects
3. animation: it is the describing how objects change in time
Question 3: The parts of Display processor are the following

1. Display File Memory: It is used for generation of the picture. It is used for identification
of graphic entities.
2. Display Controller: It handles interrupt, it maintains timings and It is used for
interpretation of instruction.
3. Display Generator: It is used for the generation of character and It is used for the
generation of curves.
4. Display Console: It contains CRT, Light Pen, and Keyboard and deflection system.
Question 4: The two classification of printers are the following:

1. Impact Printers: These are printers that print the characters by striking against the ribbon
and onto the papers are known as Impact Printers.
2. Non-Impact Printers: These are printers that print the characters without striking
against the ribbon and onto the papers are called Non-Impact Printers. These printers print
a complete page at a time, therefore, also known as Page Printers.
Question 5: The main difference between vector and raster graphics is that raster graphics
are composed of pixels, while vector graphics are composed of paths. A raster graphic,
29
such as a gif or jpeg, is an array of pixels of various colors, which together form an image.
Key points
1. Computer Graphics: It is the creation of pictures with the help of a computer.
2. Modeling: It is the creating and representing the geometry of objects in the 3D world
3. Rendering: It is the generating 2D images of the objects
4. Animation: It is the describing how objects change in time
5. LCD (Liquid Crystal Display): It is a type of flat panel display which uses liquid crystals in its
primary form of operation.
6. Light Emitting Diode LED Display: It is a flat panel display that uses light emitting diodes as
the video display.
7. Cathode-Ray Tube (CRT): It is a vacuum tube that contains one or more electron guns and a
phosphorescent screen and is used to display
images.
8. Electron gun: It consist of a series of elements, primarily a heating filament (heater) and a
cathode.
9. Control Electrode: It is used to turn the electron beam on and off.
10.Focusing system: It is used to create a clear picture by focusing the electrons into a narrow
beam.
11.Deflection Yoke: It is used to control the direction of the electron beam. It creates an electric
or magnetic field which will bend the electron beam as it passes through the area.
12.Random Scan Display: it also known as vector displays or stroke-writing displays or
calligraphic displays.
13.Raster Scan Display: It is based on intensity control of pixels in the form of a rectangular box
called Raster on the
screen.
14.Frame Buffer: It is also known as Raster or bit map. In Frame Buffer the positions are called
picture elements or pixels. Beam refreshing is of two types.
15.Display File Memory: It is used for generation of the picture. It is used for identification of
graphic entities.
16.Display Controller: It handles interrupt, it maintains timings and It is used for
interpretation of instruction.
17.Display Generator: It is used for the generation of character and It is used for the generation
of
curves.
18.Display Console: It contains CRT, Light Pen, and Keyboard and deflection system.
19.Input Devices: These are the hardware that is used to transfer transfers input to the computer.
The data can be in the form of text, graphics, sound, and text.
20.Output devices: These are display data from the memory of the computer, It can be text,
numeric data, line, polygon, and other objects.
21.Printers: It is the most important output device, which is used to print data on paper. It is
an electromechanical device, which accepts data from a computer and translates them
into form understand by users.
22.Impact Printers: These are printers that print the characters by striking against the ribbon and
onto the papers are known as Impact Printers.
23.Non-Impact Printers: These are printers 30 that print the characters without striking
against the ribbon and onto the papers are called Non-Impact Printers. These printers print a
complete page at a time, therefore, also known as Page Printers.
24.Dot matrix: Type of printer that has printed in the form of dots.
25.Daisy Wheel Printers: These printer Head is lying on a wheel and Pins corresponding
to characters are like petals of Daisy.
26.Drum Printers: These are line printers, which prints one line at a time. It consists of a drum.
The shape of the drum is cylindrical.
27.Chain Printers: These are called as line printers. These are used to print one line at
a line. Basically, chain consists of links.
28.Inkjet Printers: These printers use a special link called electrostatic ink. The printer head has
a special nozzle.
29.Laser Printers: These are non-impact page printers. They use laser lights to produces the
dots needed to form the characters to be printed on a page & hence the name laser printers.
30.Plotters: It a special type of output device, that can produce high-quality output on large
sheets,
and It is used to provide the high precision drawing which can produce graphics of various sizes
31.Drum Plotter: It consists of a drum. Paper on which design is made is kept on the drum. The
drum can rotate in both directions.
32.Flatbed Plotter: It is used to draw complex design and graphs, charts. It can be kept over the
table.
33.General Purpose Packages: It has a 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.
34.Special Purpose Packages: These packages are designed for non-programmers, so that
these users can use the graphics packages, without knowing the inner details.
35.Digital image processing: it deals with manipulation of digital images through a digital
computer.
It is a subfield of signals and systems but focus, particularly on images.

31
36.Pixel: It is simply the smallest addressable element of a picture represented on a screen.
37.Bitmap: It is a mapping from some domain (for example, a range of integers) to bits, that is,
values which are zero or one.
References and Supplementary Materials
Books
1. Donald D Hearn, M. Pauline Baker, Computer Graphics C version, Pearson Education.
2. James D. Foley, Andries van Dam, Steven K. Feiner, John F. Hughes, Computer
Graphics: Principles & Practice in C, Addison Wesley Longman.
3. Zhigang Xiang, Roy A Plastock, Computer Graphics, Schaums Outline, TMH.

Online Supplementary Reading Materials javatpoint.com/computer-graphics


tutorialspoint.com/dip/computer_vision_and_graphics

32

You might also like