You are on page 1of 36

Computer Graphics

IT-673 IT 7th
Chapter 1 Introduction of GC
Instructor: Raheel Sarwar

1
Object
ar
eel Sarw

Introduction to Computer Graphics; display memory;


tor: Rah

generation of points, vectors, shapes, objects, etc.;


hics
ter Grap
Instruc

raster and geometric graphics; interactive and passive


graphics; graphics peripherals; analog and digital images
Compu

and analog/digital conversion; mathematics of 2-D and3-D


transformations; applications in animation, computer aided
design and instruction; hypertext and multimedia; dialog
design; user-interface.

2
Instruc
t
or: Rah
Compu eel Sarw
ter Grap ar
hics

3
Courses Outline
ar
eel Sarw

• Overview of the graphics process: Computer Graphics Basics, Applications of graphics,


or: Rah

• Interactive graphics programming, graph plotting, windows and clipping, and


hics

segmentation.
t


Instruc
ter Grap

Graphics hardware: Output Devices, Input Devices, Processing Devices


• Fundamental algorithms: Line Drawing Algorithms, Programming raster display systems,
• panning and zooming, Raster algorithms and software, scan-Converting lines, characters
Compu

andcircles, Region filling and clipping, rendering, shading, colour and animation.
• 2D and 3D geometric transformations: Scaling, Rotation, other basic transformations
• Two dimensional viewing: viewing pipeline, clipping, and windowing.
• Three dimensional viewing: viewing pipeline, viewing parameters, projections, viewing
• transformations, clipping, visible surface detection, 3D to 2D projections and camera
• transformation
• Parametric curves and surfaces: Bezier, B-Spline, Curve and surface design
• Introduction to illumination models and surface rendering
• Animation techniques: tweening, double buffering, scene graph manipulation.

4
Object
ar
eel Sarw

Sessional Marks: 25 Marks


or: Rah
hics

Quiz 5 Marks
t
Instruc
ter Grap

Project 5 Marks
Compu

Assignment 5 Marks
Presentation 5 Marks
class participation 5 Marks

Mid Semester Exam: 25 Marks


Final Semester Exam: 50 Marks
5
1) Computer Graphics, Principles and Practice, J.
D. Foley, A. van Dam, S. K. Feiner and J F.

Reference Hughes,

Materials 2)Addison-Wesley Computer Graphics, F.S.Hill,


Books Maxwell MacMillan

3)Computer Graphics with OpenGL, 3rd Edition,


Hearn and Baker, Pearson Prentice Hall

6
What is computer graphics?
ar
eel Sarw

• The computer graphics is one of the most effective and commonly used way
or: Rah
hics

to information in form of graphics object such as pictures, charts, graphs and


t
Instruc
ter Grap

diagram instead of simple text.


Compu

Computer graphics is the computational creation and manipulation of visual


data

• Computer graphics is a process of generating, manipulating, storing and


displaying graphics object.

Ex: Such as pictures, charts, graphs, diagrams.

7
One Picture is Worth More Than Ten
ar
eel Sarw

Thousand Words
or: Rah
hics
t
Instruc
ter Grap
Compu

A Computer is worth a millions of pictures

8
Father computer graphics
ar
eel Sarw

• Ivan Sutherland introduced


or: Rah

concepts such as 3-D computer


hics

modeling, visual simulations,


t
Instruc
ter Grap

computer aided design (CAD) and


virtual reality
Compu

• In 1963, Ivan Sutherland engineered


a revolution in computer graphics
with his highly-interactive program
Sketchpad. It enabled users to design
and draw in real time directly on the
computer display, using a light pen.

9
Applications of Computer Graphics
ar
eel Sarw

• Graphical User Interface (GUI): It is a way of interacting with a


or: Rah

computer using the icon, menu, and other visual, graphics by which
hics

user easily interacts.


t
Instruc
ter Grap
Compu

10
Applications of Computer Graphics
ar
eel Sarw

• Art: Computer Graphics provides a new way of making


or: Rah
hics

designs. Many artists and designers use illustrator, coral


t
Instruc
ter Grap

draw, Photoshop, adobe muse, and other types of


applications for creating new designs.
Compu

•.

11
Applications of Computer Graphics
ar
eel Sarw

• Entertainment:
or: Rah

Computer graphics allow the user to make animated movies and games.
hics
t

Computer graphics are used to create scenes. Computer graphics are also
Instruc
ter Grap

used for special effects and animations.


Compu

12
Applications of Computer Graphics
ar
eel Sarw
or: Rah

• Presentations: Computer graphics are used for making charts, bar


hics

diagrams, and other images for the presentation purpose, with the
t
Instruc
ter Grap

graphical presentation the user, can easily understand the points.


Compu

13
Applications of Computer Graphics
ar
eel Sarw

• Engineering Drawings: Computer Graphics has also provided us


or: Rah

the flexibility to make 3D models, house circuits and engineering


hics

drawings, etc. which is helpful for us.


t
Instruc
ter Grap

• CAD/CAM: CAD/CAM is also known as Computer-aided design


and computer-aided manufacturing. CAD/CAM is used to design
Compu

and build prototypes, finished products, and manufacturing


processes.

14
Applications of Computer Graphics
ar
eel Sarw

• Education and Training: Computer graphics are also


or: Rah

used to provide training to students with simulators.


hics

The students can learn about the machines without


t
Instruc
ter Grap

physically trying them.


Compu

15
Applications of Computer Graphics
ar
eel Sarw

• Flight Simulator: Computer graphic is used to provide training to


or: Rah

pilots of aircraft. The pilots give much time to a flight simulator


hics
t

on the ground instead of real airplanes.


Instruc
ter Grap

• Medical Imaging: MRIs, CT scans, and other internal scans are


Compu

possible because of computer graphics.

16
Applications of Computer Graphics
ar
eel Sarw

• Printing Technology: Computer graphics are used in textile


or: Rah

designing and flex printing.


hics

• Typography: Use of character pictures to replace the rough form


t
Instruc
ter Grap

of the past in printing.


• Satellite Imaging: Computer graphics are used to forecast the
Compu

movement of the cloud and to predict the weather.


• Cartography: Computer graphics are used in map drawing.

17
Applications of Computer Graphics
ar
eel Sarw

Augmented Reality vs Virtual Reality


or: Rah
hics
t
Instruc
ter Grap
Compu

18
Applications of Computer Graphics
ar
eel Sarw

Augmented Reality vs Virtual Reality


or: Rah
hics
t
Instruc
ter Grap
Compu

19
Types of Computer Graphics
ar
eel Sarw

•Raster Graphics:
In raster, graphics pixels are used for an image to be drawn. It is also known
or: Rah

as a bitmap image in which a sequence of images is into smaller pixels.


hics

Basically, a bitmap indicates a large number of pixels together.


t
Instruc
ter Grap

•Vector Graphics:
In vector graphics, mathematical formulae are used to draw different types
Compu

of shapes, lines, objects, and so on.

20
Instruc
t
or: Rah
Compu eel Sarw
ter Grap ar
hics
Types of Computer Graphics

21
User Interaction
ar
eel Sarw

Interactive Computer Graphics (ICG)


or: Rah

ICG involve two way communications between the user and


hics

computer The user controls the contents, structure, and appearance


t
Instruc
ter Grap

of objects and images by using input devices such as keyboard,


mouse, or touch sensitive panel on the screen ICG improves the
bandwidth of communication between user and m/c.
Compu

•Non -Interactive Computer Graphics (ICG)


User/Observer has no control over the pictures/images on the screen.
–Ex: Titles displayed on TV system or other computer art.
- Used to present the quantitative information and performance of an
industrial plant or Business organization –Ex: Bar charts, Pie charts
etc., Scientific Graphics - Includes program flow charts, control flow
diagrams, curve fittings, X-Y plots etc., Cartography, drafting, raster
painting, animation and artwork.

22
Computer Graphics System
ar
eel Sarw

Input Devices
Physical: Keyboard, mouse, touch pad, touch screen, data glove, camera, light
or: Rah

pen, wand, joystick,, microphone, speech recognizer, etc.


hics
t
Instruc
ter Grap

Logical: String, locator, pick, choice, valuator, stroke.


Compu

Output Devices
Examples: CRT display, LED display, LCD display, Plasma display, printer,
plotter, e-paper, hologram generator, 3d Printer film recorder, sound recorder,
speaker, robot arm, etc.

23
Objects vs. Images
ar
eel Sarw

• Objects are the (usually 3-D) conceptual


entities that exist in their own
or: Rah

coordinate systems (Cube, Polyhedron)


hics

images are the (usually 2-D)


t
Instruc
ter Grap

realizations of objects on some media.


(Pixel, Line, circle)
Compu

Objects Image

24
_

Digital Image
ar
eel Sarw

Digital image = a multidimensional


array of numbers (such as intensity
or: Rah

image) or vectors (such as color


hics

image)
t
Instruc
ter Grap
Compu

Each component in the 10 10 16 28


 9 656 54 7026 56  43
image called pixel associates 15 37 96 5667 78
32 99

60 70 
with the pixel value (a single 25 5413 47
21 
number in the case of intensity 32 2242 90 96 67
54 85 43 
images or a vector in the case 87 85
153265 65
39 39 92
65 87  99
of color images).
What is pixel?
ar
eel Sarw

• A pixel is the smallest unit of a digital image or graphic


or: Rah

that can be displayed and represented on a digital display


hics

device.
t
Instruc
ter Grap

• A pixel is the basic logical unit in digital graphics. Pixels


Compu

are combined to form a complete image, video, text, or any


visible thing on a computer display.
• A pixel is also known as a picture element (pix = picture,
el = element).

26
ar

Pixel intensity value Consider the following image


eel Sarw

(2724x2336 pixels) to be 2D
f(1,1) = 103 function or a matrix with rows
or: Rah

and columns
hics
t

Pixel location In 8-bit representation


Instruc
ter Grap

Pixel intensity values


change between 0 (Black)
Compu

and 255 (White)

rows columns

f(645:650,1323:1328) =
83 82 82 82 82 82
82 82 82 81 81 81
82 82 81 81 80 80
82 82 81 80 80 79
80 79 78 77 77 77
80 79 78 78 77 77

f(2724,2336) = 88
What is frame buffer ?
ar
eel Sarw

• An area of memory used to store information related to the pixels


of a display.
or: Rah
hics
t


Instruc
ter Grap

A frame buffer for a color display has a set of planes each defining
one bit of the color information of each point.
Compu

• Typically a color display will have a frame buffer with up to 24


planes, 8 each for defining red, green, and blue values

28
Instruc
t
or: Rah
Compu eel Sarw
ter Grap ar
hics
What is frame buffer ?

29
What is Resolution?
ar
eel Sarw

• Resolution measures the number of pixels in a


or: Rah

digital image or display. It is defined as width by


hics

height, or W x H, where W is the number of


t
Instruc
ter Grap

horizontal pixels and H is the number of vertical


pixels. For example, the resolution of an HDTV is
Compu

1920 x 1080.

• PPI refers to the number of pixels contained


within one inch of an image displayed on a
computer monitor

• DPI refers to the number of printed dots contained


within one inch of an image printed by a printer.

30
What is Resolution?
ar
eel Sarw

How is ppi calculated?


or: Rah

Diagonal In Pixels = √(width² + height²)


hics

√(1920² + 1080²)
t
Instruc
ter Grap

=√3686400+1166400
2202/5
Compu

440

31
What is Resolution?
ar
eel Sarw

Calculating the mega pixels of the camera


or: Rah

Lets say we have an image of dimension: 2500 X


hics

3192.
t
Instruc
ter Grap

Its pixel resolution = 2500 * 3192 = 7982350


bytes.
Dividing it by 1 million = 7.9 = 8 mega pixel
Compu

(approximately).

32
What is Aspect ratio ?
ar
eel Sarw

• Aspect ratio is the ratio between width (horizontal ) of an


or: Rah

image and the height ( vertical)of Computer graphics.


hics

• Example: The term is also used to describe the dimensions of


t
Instruc
ter Grap

a display resolution.
1) a resolution of 800x600, 1027x768, 1600x1200 has an
Compu

aspect ratio of 4:3.


2) Resolution 1280x1024 has an aspect ratio 5:4
3) Resolution 2160x1440, 2560x1700 has an aspect ratio 3:2
• Aspect ratio plays an important role in resizing.
• During resizing, the aspect ratio must remain same in order to
keep the image undistorted.
• A distorted aspect ratio leads to stretching of the image.

33
Instruc
t
or: Rah
Compu eel Sarw
ter Grap ar
hics
What is Aspect ratio ?

34
What is Refresh Rates?
ar
eel Sarw

• The number of times a display's image is repainted or


refreshed per second.
or: Rah
hics

• The refresh rate is expressed in hertz (Hz), so a refresh rate of 60


t
Instruc
ter Grap

Hz means the image is refreshed 60 times in a second


Compu

35
THANK YOU

36

You might also like