Skip to main content
Unit–I: Fundamentals of Computer Graphics
and Raster Scan Graphics
Computer Graphics
1.1 Basics of Computer Graphics
Definition
Computer Graphics is the branch of computer
science that deals with creating, storing,
manipulating, and displaying pictures, images,
and visual information using computers.
• Example Applications
• Computer-Aided Design (CAD)
• Video Games
• Animation and Movies
• Medical Imaging
• Virtual Reality (VR)
• Scientific Visualization
• Education and Training
• Image Processing
• Graphical User Interfaces (GUI)
Scope of Computer Graphics
• Computer graphics is widely used in:
1. Engineering Design
• Building plans
• Machine parts design
• Circuit design
2. Entertainment
• Movies
• Animation
• Gaming
3. Education
• Interactive learning
• Simulations
4. Medical Field
• MRI visualization
• CT scan analysis
Graphics Standards
• Graphics standards ensure that graphical data is displayed
consistently across different systems.
• Common Graphics Standards
1. GKS (Graphics Kernel System)
• First international graphics standard.
• Device-independent.
2. PHIGS (Programmer's Hierarchical Interactive Graphics
System)
• Supports 3D graphics.
• Interactive graphics applications.
3. OpenGL
• OpenGL
• Open-source graphics library.
• Used for 2D and 3D graphics.
4. DirectX
• Microsoft DirectX
• Developed by Microsoft.
• Mainly used for gaming applications.
• Shapes in Computer Graphics (Basic graphical objects):
• Point
• A single pixel location. Example:(10,20)
• Line
• Connects two points.
• Circle
• All points at equal distance from center.
• Rectangle
• Four-sided polygon.
• Polygon
• Closed figure with multiple sides.
• Examples: Triangle ,Pentagon ,Hexagon
Colors in Computer Graphics
• Color is represented through intensity values.
• RGB Model
• Most common color model.
• R = Red
• G = Green
• B = Blue
Example:
Color RGB Value
Red (255,0,0)
Green (0,255,0)
Blue (0,0,255)
White (255,255,255)
Black (0,0,0)
Color Interaction
• Color interaction refers to how colors affect each other when
displayed together.
• Example:
Black text on white background.
Harmony
Pleasant combination of colors.
• Example:
Blue and Green.
Brightness Effect
Nearby colors can appear lighter or darker.
Graphical User Interface (GUI)
• A GUI allows users to interact using graphical elements.
Features of GUI
• Windows
• Display application content.
• Icons
• Represent files or programs.
• Menus
• List commands.
• Buttons
• Advantages
• Easy to use
• User friendly
• Less typing required
• Faster interaction
1.2 Raster Scan and Random Scan Display Devices
Raster Scan Display
Definition
• Raster scan display uses a matrix of pixels.
• The screen is scanned line by line from top to bottom.
Working
• Electron beam starts from top-left.
• Moves horizontally.
• Completes one line.
• Moves to next line.
• Repeats until bottom.
Characteristics
• Pixel based
• Suitable for images
• Used in modern monitors
Advantages
• Realistic images
• Supports shading
• Supports color graphics
Disadvantages
• Requires more memory
• Lower line quality
Example
• LCD Monitor
• LED Monitor
Random Scan Display (Vector Display)
Definition
• Random scan displays draw only required lines.
• Beam moves directly between points.
Working
• Beam moves to starting point.
• Draws required line.
• Moves to next line.
Characteristics
• Line based
• Better line quality
• Less memory required
Advantages
• High resolution lines
• Smooth graphics
Disadvantages
• Cannot display realistic images
• Not suitable for complex scenes
Raster Scan vs Random Scan
Feature Raster Scan Random Scan
Method Pixel Based Line Based
Memory High Low
Image Quality Good for Pictures Good for Lines
Cost Low High
Speed Faster Slower
Used In Modern Monitors Vector Displays
1.3 Line Drawing Algorithms
• Line drawing algorithms determine pixels required to
display a line.
• Digital Differential Analyzer (DDA) Algorithm
• Principle
• A line is generated using incremental calculations.
• Given:
• (x1,y1)
(x2,y2)
• Calculate:
•
(increments)
• DDA Formula( digital differential analyzer)
DDA Algorithm Steps
• Read starting point.
• Read ending point.
• Calculate dx and dy.
• Find steps.
• Calculate increments.
• Plot first point.
• Generate remaining points.
Example
• Draw line from:
• (2,2) to (8,5)
• Step 1
• dx = 8-2 = 6
dy = 5-2 = 3
• Step 2
• steps = max(6,3)=6
• Step 3
• xinc = 6/6 = 1
yinc = 3/6 = 0.5
• Advantages
• Easy implementation
• Simple calculations
• Disadvantages
• Uses floating-point operations
• Less efficient
What is a Line Drawing Algorithm?
• A Line Drawing Algorithm is a method used to determine
which pixels should be turned ON to display a straight line
on a computer screen.
• Since a computer screen is made up of tiny square pixels, it
cannot draw a perfectly continuous line. Instead, it lights up
the nearest pixels to form a line.
• There are two famous line drawing algorithms:
• Digital Differential Analyzer (DDA)
What is DDA Algorithm?
• Definition:
• The Digital Differential Analyzer (DDA) is an incremental
scan conversion algorithm that calculates intermediate
points between two endpoints using floating-point
arithmetic.
• It works by increasing one coordinate step by step and
calculating the corresponding coordinate using the slope of
the line.