Computer Graphics for Students
Computer Graphics for Students
Compiled By:
Biswaraj Baral
Pokhara University
Chapter-1
Introduction: Computer Graphics
●
Introduction to Computer Graphics
●
Raster and Random Scan Systems
●
Video Controller and Frame Buffer
●
Graphics Software
●
Graphics Hardware and Graphics Cards (GPUs)
●
Recent Trends in Computer Graphics
1. Introduction
●
Computer + Graphs + Pics
●
Computer : input – process – output
●
Graphs: point → line → curves → shapes
●
Pics: picture, image, pixel (colorful)
1. Introduction
●
The word “graphics” comes from the Greek word “graphikos”
which means ‘something written’ eg autograph
●
So, graphics are visual images or designs on some surface,
such as a wall,canvas, screen, paper, or stone to inform,
illustrate, or entertain.
●
Computer Graphics is a field that is concerned with all aspects of
producing pictures or images using a computer with the help of
data structure, graphics algorithm and programming. i.e.
●
Computer graphics = Data Structure + Graphics Algorithm +
Language
●
Computer Graphics includes the creation; storage and
manipulation of images of objects those come from diverse fields
such as physical, mathematical engineering, architectural abstract
structures and natural phenomenon.
●
We use different input and display devices to generate & perform
the modification on the digital images. Some such devices are
keyboard, mouse, or touch sensitive panel, monitors etc.
●
Some considerable terminologies on the computer graphics are:
– Modeling: Modeling is a process of creating a three-dimensional
representation of an object or part of an environment
– Rendering: generating 2D images of the 3D objects
– Animation: describing how objects change in time
History of Computer Graphics
●
Computer graphics today is largely interactive; that is the user controls the contents
structure and appearance of images of the objects by using input devices such as a
keyboard, mouse, or touch sensitive panel on the screen
●
Until the early 1980’s computer graphics was a small specialized field, largely because the
hardware was expensive and graphics based application programs that were easy to use
and cost effective were few.
●
Then personal computers with built in raster graphics displays such as the Xerox Star
Apple Macintosh and the IBM PC – popularized the use of bitmap graphics for user
computer interaction.
●
Bitmap: ones and zeros representation of the rectangular array of points on the screen.
●
Each point is called a pixel, short for “picture elements”
●
Once the bitmap graphics became affordable an explosion of easy to use and
inexpensive graphics based user interfaces allowed millions of new users to control simple
low cost application programs such as word processors, spreadsheets and drawing
programs
●
Desktop:
– The concept of a “desktop” now became popular
metaphor for organizing screen space. By means of a
window manager the user could create position and
resize rectangular screen areas called windows. This
allowed user to switch among multiple activities just by
pointing and clicking at the desired window , typically with
a mouse.
●
Even people who do not use computers encounter computer
graphics in TV commercials and as cinematic special effects.
Thus computer graphics is an integral part of all computer user
interfaces, and is indispensable for visualizing 2D, 3D objects in
all most all areas
●
Years and Major Achievements
●
1950 : First Graphics Images were created
●
1951: CRT monitors on Main Frame computer were instroduced
●
1959: CAD was used to design cars
●
1961: First video game named “Space War”developed
●
1963: First Hidden Line and Hidden surface removal algorithms developed.
●
1965: DDA algorithm developed by Jack Bresenham
●
1973: First use of 2D animations
●
1982: AutoCAD was released.
●
2001: First digital film name “The Spirits Within”with digital actors
●
2006: Google acquired sketchup (web-based CAD system- 3d design software)
●
2015: “Big Data” used for constructing animation
●
2018: Now, we can create “realistic” graphics on mobile phones. We can also create
a completely Computer-generated imagery (CGI)-based human face in real-time.
Difference Between Computer Graphics and Image
Processing
Computer Graphics Image Processing
Computer Graphics involves Image Processing involves in analyzing
In generating images from standard the images to generate standard graphical
graphical models. models.
It includes the creation storage and It is the part of computer graphics that
manipulation of images or objects. handles image manipulation or
interpretation.
●
Computer graphics is used today in many different areas of science, engineering ,
industry business, education, entertainment, medicine art and training
1. User Interfaces
●
most applications have user interfaces that rely on the
desktop window systems to manage multiple simultaneous
activities and on point and click facilities to allow users to
select menu items, icons, and objects on the screen These
activities fall under computer graphics.
●
Typing is necessary only to input text to be stored and
manipulated. For example, word processing spreadsheet
and desktop publishing programs are the typical examples
where user interface techniques are implemented
2. Plotting
●
plotting 2D and 3D graphs of mathematical physical and
economic functions use computer graphics extensively.
●
The histograms, bar and pie charts, the task scheduling
charts, are the most commonly used plotting .
●
These are all used to present meaningfully and concisely
the trends and patterns of complex data
3. Office automation and electronic publishing
●
computer graphics has facilitated the office automation
and electronic publishing which is also popularly known
as desktop publishing, giving more power to the
organizations to print the meaningful materials in house.
●
Office automation and electronic publishing can produce
both traditional printed (hardcopy) documents and
electronic (softcopy) documents that contain text tables,
graphs and other forms of drawn or scanned in graphics
4. Computer aided drafting and design
●
one of the major uses of computer graphics is to design
components and systems of mechanical , electrical ,
electrochemical and electronic devices , including
structures such as buildings automobile bodies, airplane
and ship hulls, very large scale integrated (VLSI) chips
optical systems and telephone and computer networks .
●
These designs are more frequently used to test structural
, electrical and thermal properties of the systems
5. Scientific and business visualization
●
Generating computer graphics for scientific, engineering
and medical data sets is termed as scientific visualization
where as business visualization is related with the non
scientific data sets such as those obtained in economics.
●
Visualization makes easier to understand the trends and
patterns inherent in huge amount of data sets. It would
otherwise be almost impossible to analyze those data
numerically
6. Simulation
●
Simulation is the imitation of the conditions like those, which is
encountered in real life. Simulation thus helps to learn or to feel the
conditions one might have to face in near future with out being in
danger at the beginning of the course. For example, astronauts can
exercise the feeling of weightlessness in a simulator, similarly a pilot
training can be conducted in a flight simulator .
●
The military tank simulator the naval simulator, driving simulator , air
traffic control simulator, heavy duty vehicle simulator and so on are
some of the mostly used simulator in practice. Simulators are also
used to optimize the system
●
For example the vehicle, observing the reactions of the driver during
the operation of the simulator
7. Entertainment
●
Disney movies such as Lion King and the beauty and the beast,
and other scientific movies like star trek are the best examples of
the application of computer graphics in the field of entertainment.
●
Instead of drawing all the necessary frames with slightly
changing scenes for the production of cartoon film only the key
frames are sufficient for such cartoon film where the in between
frames are interpolated by the graphics system dramatically
decreasing the cost production while maintaining the quality.
●
Computer and video games such as Fifa, Formula-1, Doom and
Pools are few to name where computer graphics is used
extensively
8. Art and commerce
●
Here computer graphics is used to produce pictures that
expresses a message and attract attention such as a
new model of a car moving along the ring of the Saturn.
●
These pictures are frequently seen at transportation
terminals, supermarkets, hotels etc. the slide production
for commercial , scientific, or educational presentations
is another cost effective use of computer graphics. One
of such graphics packages is “PowerPoint”.
9. Cartography
●
Cartography is a subject which deals with the making of
maps and charts.
●
Computer graphics is used to produce both accurate and
schematic representations of geographical and other
natural phenomena from measurement data.
●
Examples include geographic maps, oceanographic charts,
weather maps, contour maps and population density maps
●
Surfer is one of such graphics packages which is
extensively used for cartography
1.2 Raster and Random Scan Systems
1.2.1 Display Devices
●
The devices which can give the user interface of the inputted data are
the display devices.
●
In the case of computer, the monitor is most common display device
that can be categories as the Cathode Ray Tube (CRT) monitor and
the flat panel monitor.
●
To display the image, computers have some assigned memory called
the frame buffer.
●
The graphic cards also have the memory buffer and the graphics
processors so that it can increase the display strength of the computer
graphics.
Display Devices: CRT
●
CRT stands for Cathode Ray Tube.
●
CRT is a technology used in traditional computer monitors and televisions.
●
The image on a CRT display is created by firing electrons from the back of
the tube to phosphors located towards the front of the display (Phosphors
coated screen).
●
It modulates, accelerated, and deflects electron beams onto the screen to
create the images.
●
CRT converts electrical signal (voltage, current) signal into a visual signal.
●
Once the electrons hit the phosphors, they light up and are projected on
the screen.
●
The color you see on the screen is produced by a blend of red, blue, and
green light, often referred to as RGB.
Components of CRT:
– Electric Gun: The electron gun creates a source of electrons which are
focused into a narrow beam directed at the face of the CRT.
– Focusing System: Initially electrons are scattered, so focusing system
is sued to create a clear picture by focusing the electron into a narrow
beam.
– Deflection System: It is used to control the direction of the electron
beam. It consists of two parallel plates used for both horizontal and
vertical deflection. We increase the positive potential of these
deflection plate to adjust where we want to hit the electron beam on
that screen.
– 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.
●
Two Methods are used in Color CRT for the raster display method: Beam
penetration method and Shadow mask method
1) Beam Penetration Method:
– In this, different colors are coated on an inner surface
on the screen in multiple layers; typically two layers of
phosphorus, such as red(red) and green(outer) are
coated.
– Display of color depends on the depth of penetration
of the electron beam into the phosphor layers
– A beam of slow electrons excites only the outer red
layer
– A beam of very fast electrons penetrates thru the red
phosphor and excites the inner green layer
– Intermediate is a combination of red and green so two additional colors orange and
yellow color.
– When quantity of red is more than green then color appears as orange
– When quantity of green is more than red then color appears as yellow
– Screen color is controlled by the beam acceleration voltage.
– Only four colors possible, poor picture quality
●
2) Shadow Mask Method
●
It allows for the production of a much wider range of colors when compared to the beam-penetration
method.
●
The shadow mask is a thin metal sheet with thousands of tiny holes or slots arranged in a precise
pattern. It is positioned just behind the phosphor-coated screen of the CRT.
●
Three electron beams (corresponding to red, green, and blue) are emitted from the electron guns.
These beams pass through the holes or slots in the shadow mask.
●
On the front of the CRT screen, there are groups of phosphor dots known as phosphor triads. Each triad
consists of individual red, green, and blue phosphor dots that are close to each other.
●
As the electron beams pass through the holes in the shadow mask, they strike the corresponding
phosphor dots on the screen. The interaction between the electron beams and the phosphors causes
them to emit light. By varying the intensity of the electron beams, different colors can be produced.
Display Devices
Some Terminologies
●
Image: An image is a visual representation of something. It is a
2 dimensional light intensity function f(x,y) where (x,y) are the
spatial co-ordinate and f(x, y) is proportional to brightness or
intensity or gray value of the image at that point.
●
Pixel: Pixels are the smallest unit in a digital display. Graphic
displays are like very large dot matrices. Each dot in a graphic
display is called picture element, pixel or pel. The capabilities of
a graphic display depend on number of pixels horizontally and
vertically.
●
Bit Map and Pixel map (or pixmap):
– A pixmap stores and displays a graphical image as a rectangular array of pixel
color values.
– If a pixel has only two color values (i.e. black and white), it can be encoded by a
1 bit of information. On a black and white system with one bit per pixel, the
frame buffer is called bitmap.
– An image of more than two colors is called pix map.
●
Color Depth (Bit Depth):
– The number of colors a video card displays is determined by its bit depth
– The video card’s bit depth, also called the color depth, is the number of bits it
uses to store information about each pixel i.e. 8-bit video card uses 8 bits to
store information about each pixel; this video card can display 256 colors
(2x2x2x2x2x2x2x2)
– i.e. 24-bit video card uses 24 bits to store information about each pixel and can
display 16.7 million colors
– The greater the number of bits, the better the resulting image
●
Resolution: Resolution is defined as the maximum number of
points that can be displayed horizontally and vertically with out
overlap on a display device. A monitor‟s resolution is determined
by the number of pixels on the screen, expressed as a matrix. The
more pixels a monitor can display, the higher its resolution and the
dearer its images appear. For example, a resolution of 640 X 480
means that there are 640 pixels horizontally across the screen
and 480 pixels vertically down the screen. The actual resolution is
determined by the video controller not by the monitor itself—most
monitors can operate at several different resolutions e.g. 800 x
600, 1024 x 768, 1152 x 864, 1280 x 1024.
●
Aspect ratio: An aspect ratio is a proportional relationship between
a graphic's width and height. Aspect ratios are written as a
formula: 16:9 (where 16 represents the width and 9 represents the
height).
●
Pixel per inch (PPI) and DPI (dot per inch):
– PPI describes the resolution in pixels of a digital image whereas DPI
describes the amount of ink dots on a printed image.
– Though PPI largely refers to screen display, it also affects the print size of
your design and thus the quality of the output. DPI, on the other hand, has
nothing to do with anything digital and primarily concerns print.
– Pixels per inch (PPI) refers to the number of pixels contained within each
inch of a digital image. It also refers to the set number of pixels a screen can
display.
●
Fluorescence Vs Phosphorescence:
– Electron beam hits the phosphor-coated screen with a kinetic energy that is
proportional to the acceleration voltage.
– Phosphors are characterized by color(usually red, green and blue)
persistence, which is the time for the emitted light to decay to 10% of the
initial intensity. High persistence is good for low refresh rates, but bad for
animation (“trail” is left behind with moving objects).
●
Fluorescence Vs Phosphorescence(contd)
– Fluorescence occurs when a material absorbs light energy and
immediately emits it back as light, typically within a very short time
frame. In computer graphics terms, you can think of fluorescence
like a glow effect that appears instantly when a material is exposed
to light. This effect is commonly used to create vibrant and bright
colors in digital images and animations.
– Phosphorescence, on the other hand, involves a delayed emission
of light after the material has been exposed to light energy. Unlike
fluorescence, where the emission is immediate, phosphorescence
causes the material to continue emitting light even after the light
source is removed. In computer graphics, phosphorescence can
be compared to a lingering glow effect that persists for some time
even after the initial exposure to light. This effect can be used to
create subtle and long-lasting lighting effects in digital scenes.
●
Persistence:
– Persistence is one of the major properties of phosphorous used in
CRTs.
– It means how long they continue to emit light after the electron
beam is removed.
– Persistence is defined as the time it takes the emitted light from the
screen to decay to one-tenth of its original intensity.
– Lower persistence phosphors require higher refresh rates to
maintain a picture on the screen.
– A phosphor with lower persistence is useful for animation and a
higher–persistence phosphor is useful for displaying highly complex
static pictures.
– Graphics monitors are usually constructed with the persistence of
10 to 60 microseconds.
●
Horizontal Scan Rate:
– The horizontal scan rate is the number of scan lines per second.
– The rate is approximately the product of the refresh rate and the
number of scan lines.
●
Refresh Rate:
– When electron beam strikes a dot in CRT, the surface of the CRT only
glows for a fraction of a second and then fades.
– Monitor must redraw the picture many times per second to avoid having
the screen flicker
– It is defined as the number of times per second the pixels are recharged so
that the image doesn’t flicker. It is measured in hertz(hz).
– It is also called as frame rate, horizontal scan rate, vertical frequency or
vertical scan rate
– Examples: Digital photographs, digital paintings, and detailed illustrations
are common examples of raster graphics. Normally the refresh rate varies
from 60 to 80hz.
– A refresh rate of 75 hz means that the image is redrawn 75 times a
second.
– Higher refresh rates are preferred for better comfort in viewing the monitor
Raster and Vector Graphics
●
Raster Graphics (Bitmap Graphics):
– Raster graphics represent images as a grid of pixels, where each pixel contains
color information. These images are resolution-dependent, meaning the quality
is directly tied to the number of pixels in the image.
– Each pixel has a specific color, and the entire image is a collection of these
colored pixels.
– Common file formats for raster graphics include BMP, JPEG, PNG, and GIF.
– Raster images are suitable for photographs, detailed illustrations, and complex
graphics.
– Scaling a raster image can result in a loss of quality, especially if the image is
enlarged.
– Examples: Digital photographs, digital paintings, and detailed illustrations are
common examples of raster graphics.
●
Advantages:
– Detail and Realism: Raster graphics excel at representing detailed and realistic
images, making them suitable for photographs, complex illustrations, and high-
resolution images.
– Raster images support a wide range of colors, allowing for vibrant and nuanced
color representation, which is essential for applications like digital photography and
graphic design.
●
Disadvantages:
– Raster images have a fixed resolution, and scaling them to larger sizes may result
in pixelation and loss of quality.
– Raster images are composed of pixels, and editing individual pixels can be
challenging.
– Raster graphics are not ideal for representing text at small sizes or for vector-
based output
– Raster images, especially those compressed using lossy compression algorithms
(e.g., JPEG), may exhibit compression artifacts, such as blockiness or loss of fine
details.
●
Vector Graphics:
– Vector graphics represent images using mathematical equations to
define shapes. Instead of pixels, vector graphics use points, lines,
curves, and shapes to create visual elements.
– Vector graphics are resolution-independent, meaning they can be
scaled to any size without a loss of quality.
– Common file formats for vector graphics include SVG (Scalable Vector
Graphics), AI (Adobe Illustrator), and EPS (Encapsulated PostScript).
– Ideal for illustrations, logos, and graphics that require scalability and
precision.
– Editing vector graphics is more flexible as you can modify individual
elements (lines, shapes) independently.
– Examples: Logos, icons, schematics, and illustrations with clean lines
and shapes are typical examples of vector graphics.
●
Advantages:
– Scalability: they can be scaled to any size without loss of quality.
– Vector files tend to have smaller file sizes compared to raster images, especially for
simple or geometric illustrations.
– Vector graphics are composed of mathematical paths and shapes, allowing for easy
editing and manipulation.
– Vector graphics are well-suited for representing text.
– Vector graphics are commonly used in printing because they can maintain high
quality at various print resolutions.
– Vector graphics can be easily converted to different file formats without loss of
quality.
●
Disadvantages:
– Creating realistic images with intricate details can be challenging in vector graphics.
– Vector graphics may struggle to represent subtle color variations, shadows, and
other photo-realistic effects. Raster images are generally more suitable for these
types of visuals.
●
Refresh or Raster Scan Display System
●
The term "raster" refers to the grid of pixels that make up the image.
●
In raster scan system electron beam sweeps across the screen, from top to
bottom covering one row at a time.
●
A pattern of illuminated pattern of spots is created by turning beam intensity
on and off as it moves across each row.
●
A memory area called refresh buffer or frame buffer stores picture definition.
●
This memory area holds intensity values for all screen points.
●
Stored intensity values are restored from frame buffer and painted on screen
taking one row at a time.
●
Each screen point is referred to as pixels.
●
In raster scan systems refreshing is done at a rate of 60-80 frames per
second.
●
At the end of each scan line, the electron beam returns to the left side of the
screen to begin displaying the next scan line. The return to the left of the
screen, after refreshing each scan line, is called horizontal retrace of the
electron beam.
●
And at the end of each frame, the electron beam returns to the top left corner of
the screen to begin the next frame, which is called vertical retrace.
●
Here beam is swept back & forth from left to the right. Beam intensity is turned
on and off to create a pattern of illuminated spots.
●
The screen image is maintained by repeatedly scanning the same image. This
process is known as Refreshing of Screen.
●
Frame buffer holds a set of intensity values for all the screen points.
●
That intensity is retrieved from the frame buffer and displayed on the screen
one row at a time.
●
Each screen point is referred to as a pixel or Pel (Picture Element).
●
Interlaced vs Non-interlaced Scan: In interlaced scan, each frame is
displayed in two passes. First pass for odd scan lines and another for
even ones. In non-interlaced refresh procedure, electron beam sweeps
over entire scan lines in a frame from top to bottom in one pass.
●
In interlaced scanning, each frame is divided into two fields: one containing the odd-
numbered lines (field 1) and the other containing the even-numbered lines (field 2).
Each field is displayed alternately, resulting in a complete frame being displayed over
two fields.
If the refresh rate for interlaced scanning is 50 Hz, it means that the display refreshes
50 times per second.
Since each frame consists of two fields, the number of fields created per second
would be twice the refresh rate:
Number of fields per second= 2×Refresh rate = 100 fields per second
●
Architecture of Raster Scan Display System:
●
Display Processor: Graphics program are written to display picture on the screen.
The function of display processor is to digitize a picture definition given in an
application program (graphics program) into a set of pixel-intensity values for
storage in refresh buffer. This process is referred to as scan conversion. The
purpose of display processors is to relieve the CPU from graphics jobs. (creating
different line style, displaying color areas etc)
●
When a particular command is called by the application program, the
graphics subroutine package sets the appropriate pixels in the frame buffer.
●
The video controller then cycles through the frame buffer, one scan line at
a time, typically 50 times per second.
●
It will bring a value of each pixel contained in the frame buffer and uses it to
control the intensity of the CRT electron beam.
●
So there exists a one to one relationship between the pixel in frame buffer
and that on the CRT screen.
●
Video Controller: A special purpose processor, called video controller or
display controller is used to control the operation of the display device.
Video controller reads the data from frame buffer and plots it on the screen.
The quality of the images that a monitor can display is defined by the video
controller. The video controller is an intermediary device between the CPU
and the monitor.
Vector Display / Random Scan/ Calligraphic
Display System
●
In this technique, the electron beam is directed only to the part of the screen
where the picture is to be drawn rather than scanning from left to right and top
to bottom as in raster scan. It is also called vector display, stroke-writing
display, or calligraphic display.
●
Picture definition is stored as a set of line-drawing commands in an area of
memory referred to as the refresh display file.
●
To display a specified picture, the system cycles through the set of commands
in the display file, drawing each component line in turn.
●
After all the line-drawing commands are processed, the system cycles back to
the first line command in the list.
●
Random-scan displays are designed to draw all the component lines of a
picture 30 to 60 times each second.
●
Example: Suppose we want to display a square ABCD on the screen, the
commands will be:
– Draw a line from A to B
– Draw a line from B to C
– Draw a line from C to D
– Draw a line from D to A
●
Random Scan Display Processor:
– Input in the form of an application program is stored in the system memory along
with graphics package.
– Graphics package translates the graphic commands in application program into a
display file stored in system memory.
– This display file is then accessed by the display processor to refresh the screen.
– The display processor cycles through each command in the display file program.
– Sometimes the display processor in a random-scan is referred as Display
Processing Unit / Graphics Controller.
1.3 Video Controller and Frame Buffer
13.1 Video Controller
●
Frame buffers and video controllers are integral components
used in raster graphics systems.
●
Video controller works in conjunction with the frame buffer to render images
on the display.
●
It contains the video-dedicated memory and other circuitry necessary to
send information to the monitor for display on the screen.
●
The video controller employs two registers to store the coordinates of the
screen pixels.
●
Initially, x = 0 and y = ymax (the maximum y-coordinate)
●
The video controller retrieves the pixel value stored in the frame buffer
corresponding to this pixel position and converts it into the necessary signals
to drive the display device.
●
Then, it increments the x value by 1 and retrieves the corresponding y value.
●
This process continues, retrieving pixel values line by line.
●
Once the last pixel is reached, the registers are reset to their initial values,
and the process repeats.
1.3.2 Frame Buffer
●
A frame buffer, also known as a frame-store, is a portion of computer
memory that is used to store a complete frame or image displayed on
a computer screen.
●
It plays a crucial role in computer graphics by holding the pixel values
and color information for each point on the screen, allowing the
computer to quickly refresh and update the display.
●
Graphics data, such as textures, polygons, and other visual
elements, are processed by the GPU and written to the frame buffer
before being displayed on the screen.
●
At a minimum there is one memory bit for each pixel called a bit
plane which stores the internal representation of image called frame
buffer.
●
A single-bit plane black and white frame buffer
●
A n-bit plane gray level frame buffer
●
Figure given below illustrates a system with N=3 bit planes for a total
of 8 (2^3) intensity levels. Simple 3-bit plane color frame buffer.
●
The frame buffer is a digital device and the CRT is an analog device.
●
Therefore, a conversion from a digital representation to an analog signal must
take place when information is read from the frame buffer and displayed on the
raster CRT graphic devices.
●
For this we can use a digital to analog converter (DAC).
●
This is converted into an analog voltage between 0 and the maximum voltage
of the electron gun by the DAC.
●
Each pixel in the frame buffer must be accessed and converted before it is
visible on the raster CRT.
●
Because there are three primary colors, a simple color frame buffer is
implemented with three bit planes, one for each primary color.
●
Each bit plane drives an individual color gun for each of the three primary
colors used in color video.
●
These three primaries (red, green, and blue) are combined at the CRT to yield
eight colors.
●
8 bit plane per color
frame buffer
model (full color model)
●
R= 8 bit= 2^8 =256
variants of red color;
G= 8 bit= 2^8 =256
variants of green color ;
B= 8 bit= 2^8 =256
variants of blue color
●
Total Colors
= (2^8)^3
= 2^24
=16777216
1.4 Graphics Software
●
Graphics software refers to a program that enable a person to manipulate
(create and edit) images or models visually on PC.
●
Graphics software plays a crucial role in various industries and disciplines,
enabling artists, designers, engineers, scientists, and other professionals to
create, communicate, and visualize ideas, concepts, and information in digital
form.
●
Functionality:
– Creating and Editing: creating new images or editing existing images
– Modeling and Design: creating 3D models of object
– Rendering and Visualization: Graphics software uses rendering engines and
visualization tools to create lifelike images and animations from 3D models
– Animation and Motion Graphics
– Data Visualization: visualizing data from science, engineering, finance
Some Graphics Softwares
●
Raster Graphics Editors: Software for creating and editing bitmap images
composed of pixels, such as Adobe Photoshop, GIMP, and Corel PaintShop Pro.
●
Vector Graphics Editors: Software for creating and editing vector-based graphics
composed of geometric shapes and paths, such as Adobe Illustrator, Inkscape,
and CorelDRAW.
●
3D Modeling and Animation Software: Software for creating and animating 3D
models and scenes, such as Autodesk Maya, Blender, Cinema 4D, and 3ds Max.
●
CAD Software: Computer-aided design software for creating precise technical
drawings and models, such as AutoCAD, SolidWorks, and Revit.
●
Visualization and Scientific Software: Software for visualizing and analyzing
scientific data and simulations, such as MATLAB, Mathematica, and ParaView.
●
Animation and Motion Graphics Software: Software for creating animated
sequences, visual effects, and motion graphics, such as Adobe After Effects,
Toon Boom Harmony, and Blender.
Graphics Software: Types
1) General programming packages
2) Special Purpose application Packages
●
General Programming packages:
– A general graphics programming package provides an extensive set
of graphics functions that can be used in a high-level programming
language, such as C or FORTRAN.
– 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.
– Examples: GKS (Graphical Kernel System), Graphics Library (GL),
PHIGS (Programmer’s Hierarchical Interactive Graphics System)
●
Special Purpose application Packages:
– application graphics packages are designed for non-
programmers, so that users can generate displays without
worrying about how graphics operations work.
– These packages are pre-built software solutions designed for
specific graphics tasks or industries.
– These packages often have user-friendly interfaces and built-in
features tailored to particular use cases, such as 3D modeling,
animation, architectural design, or scientific visualization.
– Examples of such applications packages are the artist's
painting programs and various business, medical, and CAD
systems: Autodesk Maya, Adobe Photoshop, Blender,
SolidWorks, AutoCAD
Software Standards
●
Primary goal of standardized graphics software is portability.
When packages are designed with standard graphics
functions, software can he moved easily from one hardware
system to another and used in different implementations and
applications.
●
International and national standards planning organizations in
many countries have cooperated in an effort to develop a
generally accepted standard for computer graphics.
●
After considerable effort, this work led to following standards:
– Graphical Kernel System (GKS)
– Programmer’s Hierarchical Interactive Graphics Standard
(PHIGS)
Software Standards: GKS
●
Graphical Kernel system (GKS) was adopted as the first graphics software
standard by the International Standards Organization (ISO) and American
National Standards Institute (ANSI).
●
Although GKS was originally designed as a two-dimensional graphics
package, a three dimensional GKS extension was subsequently developed.
●
GKS was developed to provide a common interface for graphics applications
across different hardware and software platforms, allowing programs to be
written once and run on multiple systems without modification.
●
Key features of GKS includes:
– Device independence
– Hierarchical Structure: organizes graphics operations into a hierarchical
structure
– Standardized output format
– Input Device Support
– Transformation and Clipping: GKS includes functions for
coordinate transformations, scaling, rotation, and clipping,
●
Applications of GKS:
– It is used for creating GUI or graphical user interface in
software
– It is also used in other data visualization tools to create
graph, bar chart etc.
– It can be used for rendering and analyzing geographical
data.
– It is used in educational software for the purpose of teaching
computer graphics.
Software Standards: PHIGS
●
PHIGS (Programmer’s Hierarchical Interactive Graphics Standard) is a
extension to GKS, Increased Capabilities for object modeling, color
specifications, surface rendering and picture manipulations are provided.
Subsequently, an extension of PHIGS, called PHIGS+, was developed to
provide three-dimensional surface-shading capabilities not available in
PHIGS.
●
Although PHIGS presents a specification for basic graphics functions, it
does not provide a standard methodology for a graphics interface to output
devices (i.e. still machine dependent).
●
Nor does it specify methods for storing and transmitting pictures.
●
Separate standards have been developed for these areas:
– CGI (Computer Graphics interface): Standardization for device interface
– CGM (Computer Graphics Metafile): Standards for archiving and
transporting pictures
●
Key features of PHIGS:
– Hierarchical Structure: complex graphical scenes to be
constructed from simpler components
– Graphics Primitives: supports wide range of graphics
primitives, including lines, curves, polygons, text and raster
images
– Output Independence: ensures portability and interoperability
across different systems and platforms
– Modeling and Transformations
– Input device support: keyboards, mice, tablets, joysticks etc
– Rendering and Visualization
●
Applications of PHIGS:
– Computer-aided design (CAD)
– Scientific visualization
– Geographic information systems (GIS)
– Animation and multimedia
– Virtual reality (VR) and augmented reality (AR)
– Medical imaging and visualization
1.5 Graphics Hardware and Graphics Cards (GPUs)
●
Light pen is a pointing device similar to a pen
●
It is used to select a displayed menu item or draw pictures on the monitor screen.
●
It consists of photocell and an optical system placed in a small tube.
●
When the tip of a light pen is moved over the monitor screen and the pen button
is pressed, its photocell sensing element detects the screen location and sends
the corresponding signal to the CPU (light pen is connected to cpu).
4. Digitizers
●
A digitizer is a device that receives, processes and records digitally any analog
information such as light, sound, touch, or pressure.
●
For example, a digital camera can be considered as a digitizer, as it takes
analog light information and converts it to a digital picture.
●
The process of translating data from the analog version to its digital form is
called digitization.
●
Digitizers are primarily used to facilitate writing, drawing, painting
●
It consists of a flat surface on which users can draw or write using a special
stylus or pen.
●
The digitizer captures the position of the stylus on the tablet and translates it
into digital information that the computer can use.
●
This allows users to interact with graphics software in a way that simulates
drawing or writing on paper.
5. Tablet
●
A tablet is a digitizer which enables user
to hand-draw images, animations and
graphics, with a special pen-like stylus.
●
A graphic tablet consists of a flat
pad connected to a stylus or puck
●
A stylus is a pen like device used to create sketches and images
●
A puck(tablet cursor) is a copying device used to copy an image.
A puck looks like a mouse
●
A puck is specially used to trace a drawing and store it in the
computer in digital form.
●
For sketching, either the stylus or puck is used.
●
Graphic tablets are often used to create map and engineering
drawings.
●
Digitizer mode and mouse mode:
– "Digitizer mode" creates a one-for-one correspondence between
tablet and screen.
– Wherever the tablet is touched, the screen is drawn in the exact
same location
– In contrast, "mouse mode" moves the screen pointer (cursor)
relative to any starting position on the tablet surface, just like an
ordinary computer mouse.
Types of Tablets: Electric Tablets
●
A grid of wires on ¼ to ½ inch centers is embedded under the surface of the pad.
●
Electromagnetic signals generated by electrical pulses applied in sequence to the
wires in the grid induce an electrical signal in a wire coil in the stylus or puck .
●
The strength of the signal induced by each pulse is used to determine the position of
the stylus.
●
The signal strength is also used to determine roughly how far the stylus is from the
tablet.
●
When the stylus is within ½ inch from the tablet it taken as near other wise it is
either “far” or “touching” .
●
When the stylus is near or touching, a cursor is usually shown on the display to
provide visual feedback to the user.
●
A signal is sent to the computer when the tip of the stylus is pressed against the
tablet or when any button on the puck is pressed.
●
The information provided by the tablet repeats 30 to 60 times per second
Types of Tablets: Sonic Tablets
●
The sonic tablet uses sound waves to couple the stylus to
microphones positioned on the periphery of the digitizing area
●
An electrical spark at the tip of the stylus creates sound bursts.
●
The position of the stylus or the coordinate values is calculated
using the delay between when the spark occurs and when its
sound arrives at each microphone
●
The main advantage of sonic tablet is that it doesn’t require a
dedicated working area as the microphones can be places on
any surface to form the tablet work area
●
This facilitates digitizing drawing on thick books because in an
electrical tablet this is not convenient for the stylus can not get
closer to the tablet surface
Types of Tablets: Resistive Tablets
●
Resistive tablets work by using layers of an electrically
resistive material, which contain embedded electrodes.
●
Performing a touch command will press these layers
together so that the electrodes touch each other.
●
When a battery powered stylus is activated at certain
position it emits high frequency radio signals which
induces the radio signals on conducting layer.
●
The strength of the signal received at the edges of the
tablet is used to calculate the position of the stylus.
6. Touch Panel
●
The touch panel allows the user to point at the screen directly with a finger to
move the cursor around the screen or to select the icons.
Types:
1)Optical Touch Panel:
– It uses a series of infrared light emitting diodes (LED) along one vertical edge
and along one horizontal edge of the panel
– The opposite vertical and horizontal edges contain photo detectors to form a
grid of invisible infrared light beams over the display area.
– Touching the screen breaks one or two vertical and horizontal light beams
thereby indicating the fingers position
– The cursor is then moved to this position or the icon at this position is
selected
– This is a low resolution panel which offers 10 to 50 positions in each direction
2) Sonic touch Panel:
– Bursts of high frequency sound waves traveling alternately
horizontally and vertically are generated at the edge of the
panel .
– Touching the screen causes part of each wave to be
reflected back to its source
– The screen position at the point of contact is then calculated
using the time elapsed between when the wave is emitted
and when it arrives back at the source
– This is a high resolution touch panel having about 500
positions in each direction
3) Electrical touch Panel:
– It consists of slightly separated two transparent panel one coated
with a thin layer of conducting material and the other with resistive
material
– When the panel is touched with a finger the two plates are forced
to touch at the point of contact thereby creating the voltage drop
across the resistive plate which is then used to calculate the
coordinate of the touched position
– The resolution of the touch panel is similar to that of sonic touch
panel
7. Scanner
●
A scanner is an input device, which works more like a
photocopy machine. It is used when some information is
available on paper and it is to be transferred to the hard disk of
the computer for further manipulation.
●
The scanner captures images from the source which are then
converted into a digital form that can be stored on the disk.
These images can be edited before they are printed.
1.5.2 Hard Copy Devices
●
Hard copy devices are those that give the output in the tangible form.
Printers and Plotters are two common hard copy devices.
●
Soft copy devices give output in the intangible form or the virtual form,
e.g. something displayed on a screen. All the computer monitors are
covered under this category.
●
Basic output devices includes:
– Monitor: video display terminal(VDT) / video display unit (VDU)
– Printers: for producing hard copy output
– Plotters: A plotter is a printer that interprets commands from a computer to
make line drawings on paper with one or more automated pens
Hard Copy devices: printer
●
A printer is a device that accepts text and graphics output
from a computer, and it transfers this information to paper,
sheets.
●
Printers can print any information that has been passed to
it, whether it be Text, Numbers or Images.
●
It depends on the type of printer that what quality or color
the printed matter would be.
●
Depending upon the printing methods and the quality of
images produced, printers are of two major types:
●
Impact Printers:
– There is a direct contact between the printing head and the
paper on which the print is produced. They work by striking a
head or a needle against an inked ribbon which leaves a mark
on the paper. These printers produce a lot of noise when
printing, because of the head striking the paper.
– Examples are Dot Matrix, Daisy Wheel and Line printers.
●
Non-impact printers:
– the printing head never comes in direct contact with the paper.
– These printers work by spraying ink on the paper. Electrostatic
or electromagnetic charge is used in these printers.
– Examples are Ink-Jet and Laser printers.
Hard Copy devices: Plotter
●
The plotter is a computer printer
for printing vector graphics.
●
Plotters differ from printers in that
they draw lines using a pen.
As a result, they can produce
continuous lines, whereas printers
can only simulate lines by printing
a closely spaced series of dots.
●
Multicolor plotters use different-colored
pens to draw different colors.
●
Thus, plotters are considerably more expensive than printers.
●
The various type of plotter is: Drum plotter, Flatbed plotter, Electrostatic
plotter etc.
1.5.3 Graphics Cards (GPUs)
●
GPU stands for Graphics Processing Unit.
●
GPUs are also known as video cards or graphics cards.
●
GPUs are specialized processors designed specifically for rendering
graphics and images on a display device.
●
In order to display pictures, videos, and 2D or 3D animations, each device
uses a GPU.
●
A GPU performs fast calculations of arithmetic and frees up the CPU to do
different things.
●
A GPU is a powerful processor designed to handle large-scale parallel
processing tasks, making it indispensable in modern computing for both
graphics rendering and general-purpose computational tasks. Its
architecture allows it to process large datasets efficiently, providing
significant performance improvements for a wide range of applications.
●
The calculation of GPU is faster than that of CPU
because CPU works serially and GPU performs
parallel processing.
Key Characteristics of a GPU:
●
Parallel Processing Capabilities:
– High Throughput: GPUs contain thousands of smaller cores designed to handle
multiple tasks simultaneously. This parallel processing capability makes them
ideal for tasks that can be divided into smaller, concurrent operations
– Stream Processing: The architecture of GPUs is optimized for stream
processing, where large volumes of data are processed in a continuous,
pipeline fashion.
●
Components of GPU:
– Streaming Multiprocessors (SMs): Core units within a GPU, each containing
many smaller processing units called CUDA cores (in NVIDIA GPUs) or Stream
Processors (in AMD GPUs).
– CUDA Cores / Stream Processors: Individual processors that handle basic
arithmetic and logical operations.
– Memory Hierarchy: Including global memory (VRAM), shared memory, registers,
and various caches (L1, L2) for efficient data access and storage.
– Special Function Units (SFUs): Execute more complex mathematical
operations like trigonometric functions, logarithms, and exponentials.
●
GPU Programming:
– APIs and Frameworks: Various programming models and APIs such
as CUDA (NVIDIA), OpenCL, and DirectCompute allow developers
to harness the power of GPUs for general-purpose computing
(GPGPU).
– Parallel Algorithms: Efficient GPU programming often requires
rethinking algorithms to exploit parallelism effectively.
●
Advantage of GPUs:
– Massive Parallelism
– Accelerate Performance
– Versatility: used in scientific research, financial modeling, AI
Evolution of GPU Technology
●
Nvidia was the first to market the single-chip GeForce 256 GPUs in 1999. The
2000s and 2010s marked a growth era where GPUs gained functions like ray
tracing, mesh shading, and hardware tessellation. These led to increasingly
advanced image generation and graphics performance.
●
It wasn’t until 2007 that Nvidia released CUDA, a software layer making parallel
processing available on the GPU. Around this time, it became clear that GPUs were
very effective at performing highly specific tasks. Specifically, they excelled at tasks
that require a large amount of processing power to achieve a particular outcome.
●
When Nvidia released CUDA, it opened up GPU programming to a wider audience.
Developers could then program GPU technology for all sorts of different compute-
intensive practical applications. GPU computing started to become far more
mainstream.
●
GPUs are an in-demand chip for blockchain and other emerging applications.
They're increasingly being put towards artificial intelligence and machine learning
(AI/ML).
●
Types of GPU: Integrated and Dedicated (Discrete)
●
Integrated GPU: An integrated GPU (iGPU) is a graphics processing
unit that is built into the same chip as the central processing unit
(CPU). It shares memory with the CPU and is typically found in
laptops, tablets, smartphones, and some desktop computers.
Characteristics are:
– Shared Resources: shares system’s main memory (RAM)
– Power efficiency: more power efficient
– Cost-effective
– Performance: lower performance compared to dedicated
– Uses: ideal for general-purpose computing
– Examples: Intel HD Graphics/ Intel Iris graphics, AMD Radeon
Vega Graphics
●
Dedicated GPU: A dedicated GPU (also known as a discrete
GPU) is a separate graphics processing unit that is installed as an
independent piece of hardware within a computer. It has its own
dedicated video memory (VRAM). Their characteristics are:
– Dedicated resources: have their own dedicated memory
– Higher performance
– Power consumption: more power consumption
– Upgradeability: dedicated GPUs can be upgraded
independently of the CPU
– Uses: high end gaming, professional video editing etc
– Examples: Nvidia GeForce Series,
Practical Applications for a GPU
●
GPUs can be used across a wide range of compute-intensive
applications, including large-scale finance, defense applications, and
research activities. Here are some of the most prevalent uses of GPUs
today.
– Graphics Rendering
– Gaming
– Professional Visualization: professional applications like CAD
drawing, video editing, product walkthroughs and interactivity,
medical imagery, and seismic imaging.
– Machine Learning and AI
– Blockchain
– Simulation
●
CPU vs GPU
CPU
●
GPU
Several cores Many cores
CPU emphasis on Low latency GPU emphasis on High throughput
Good for serial processing Good for parallel processing
Can do a handful of operations at Can do thousands of operations at
once once
Fewer, more powerful cores More cores than CPUs, but less
powerful than CPU cores
Best suited for general purpose Suited for high-performance
computing applications computing applications.
1.6 Recent Trends in Computer Graphics
●
Assignment
Numerical Examples:
●
1) There is a system with 24 bits per pixel and resolution of 1024
by 1024. Calculate the size of frame buffer (in Megabytes)
●
Solution:
Resolution = 1024 * 1024
Bits per pixels storage = 24 bits
Total number of pixel = 1024 * 1024 = 1048576 pixels
Therefore, total storage required in frame buffer = 1048576 * 24
= 25165824bits
= 25165824 / (8 * 1024) Kb
= 25165824 / (8 * 1024 * 1024) Mb
= 3 Mb
●
2. How Many k bytes does a frame buffer needs in a 600 x 400 pixel?
●
Suppose, n bits are required to store 1 pixel. Then, the size of frame
buffer = Resolution * bits per pixel
= (600 * 400) * n bits
= 240000 n bits
= 240000 n kb / (8 * 1024)
= 29.30 n k bytes.
●
3. Consider a RGB raster system is to be designed using 8 inch by
10-inch screen with a resolution of 100 pixels per inch in each
direction. If we want to store 8 bits per pixel in the frame buffer, how
much storage in bytes do we need for the frame buffer?
●
Solution:
Size of screen = 8 inch * 10 inch
Pixels Per inch (Resolution) = 100
Then total number of pixels = 8 * 100 * 10 * 100 = 800000 pixels
Bits per pixels’ storage =8
Therefore, total storage required in frame buffer = 800000 * 8 bits
= 6400000bits
= 6400000/8 bytes
= 800000Bytes
●
4. Find out the aspect ratio of the raster system using 8 x 10 inches’
screen and 100 pixels/inch.
●
Solution:
We know that, Aspect ratio = Width / Height
= (8 x 100) / (10 * 100)
=4/5
So, aspect ratio = 4: 5
●
5. What is the time required to display a pixel on the monitor of
size 1024 * 768 with refresh rate of 60 Hz?
●
Solution:
Refresh Rate = 60Hz → 60 frames per second
Total number of pixel in one frame = 1024 * 768 = 786432 pixels.
60 frames need 1 second
1 frame need 1 / 60 second → 786432 pixels need 1/ 60 second
→ 1 pixels need 1 / (60 * 786432 ) second
→ 109 / (60 * 786432) ns
→ 21.19 ns
●
6. If the total intensity achievable for a pixel is 256 and
the screen resolution is 640 *480. What will be the size of
frame buffer?
●
Solution:
1 pixel = 256 different intensity level
Let; x be the number of bits required to represent 256 different intensity level
Then, 2X = 256
Therefore, x= 8 bits
Resolution = 640 * 480
Hence, number of bits required for the screen = 640 * 480 * 8 = 2457600
bits.
●
7. If a pixel is accessed from the frame buffer with an average access time of 300ns then
will this rate produce an un-flickering effect for the screen size of 640 * 480.
●
Solution:
Size of screen = 640 * 480
Total Number of pixels = 640 * 480 = 307200
Average access time of one pixel = 300ns
Therefore, total time required to access entire pixels of image in the screen
= 307200 * 300 = 92160000 ns = 92160000/109 = 0.09216 seconds
i.e. 1 cycle take 0.09216 second
Now, Number of cycles per second i.e. Refresh Rate =?
0.09216 seconds = 1 cycle
1 second = 1/ 0.09216 = 10.86
Therefore, Refresh Rate= 10.86 cycles per second
Since the minimum refresh rate for unflicker image is 60 frames per second, hence we
can say the monitor produces flickering effect.
●
8.Consider a raster scan system having 12-inch by 10-inch screen with a resolution
of 100 pixels per inch in each direction. If display controller of this system refresh
the screen at the rate of 50 frames per second, how many pixels could be accessed
per second and what is the access time per pixel of the system.
●
Solution:
Size of Screen = 12 inch * 12 inch
Resolution → 100 pixels per inch
Therefore, total number of pixels in one frame = 12 * 100 * 12 * 100
Refresh Rate = 50 frames per second → 50 frames can be accessed in 1 second
Therefore, total number of pixel accessed in 1 second = 50 * 12 * 100 * 12 * 100 =
72000000 pixels.
●
Again,
Since, 50 frames can be accessed in 1 second
1 frame can be accessed in 1/50 second
●
(12 * 100 * 12 * 100) pixels can be accessed in 1/50 second
then 1 pixel can be accessed in 1 / (50 * 12 * 100 * 12 * 100)
second
= 109 / (50 * 12 * 100 * 12 * 100) ns
=13.88 ns
●
Hence, Access time per pixel = 13.88ns/pixel.
●
9. How much time is spent scanning across each row of pixels during screen
refresh on a raster system with resolution 1280 * 1024 and refresh rate of 60
frames per second?
●
Solution:
Resolution = 1280 * 1024 i.e. One frame contains 1024 scan line and each
scan line consists of 1280 pixels.
Refresh Rate = 60 frames per second i.e. 60 frame take 1 second
1 frame take 1/60 second
i.e. 1024 scan line take 1/60 second i.e. 0.0166 second
1 scan line take 0.0166/1024 = 0.016 Ms.
10. Consider a raster monitor of resolution 640*480 pixels. A scanning
is used with horizontal retrace time of 4 micro seconds and vertical
retrace time of 20 micro seconds respectively. Calculate the time
available to display a pixel for both cases of (i) non-interlaced and (ii)
interlaced. Assume a scan rate of 50 frames per seconds
Solution:
●
Case-I: Non-Interlaced:
Time per scan = 1/50=(1000/50) = 20 m sec
Retrace/ scan = (20 + 480x4) micro sec = 1.94 ms
Total time to scan pixels = 20 – 1.94 = 18.06 ms
ie time to scan (640/480) pixel = 18.06 ms
Therefore,
Time Per pixel = (18.06)/(640*480)*10^6 = 58.8 nano sec
●
Case-II: Interlaced:
In interlaced scanning, each frame is divided into two fields: one
containing the odd-numbered lines (field 1) and the other containing the
even-numbered lines (field 2). Each field is displayed alternately,
resulting in a complete frame being displayed over two fields.
Given that the refresh rate for interlaced scanning is 50 Hz, it means
that the display refreshes 50 times per second.
Since each frame consists of two fields, the number of fields created per
second would be twice the refresh rate:
Number of fields per second= 2×Refresh rate = 100 fields per second
●
Time per fields = 1/100sec = 10 ms
Retrace/field= (20+240*4) = 0.98 ms
Total time to scan pixels / field= 10-0.98 = 9.02 ms
ie time to scan (640*240) pixels = 9.02 ms
Therefore,
Time per pixel = 9.02/(640*240)*10^6 = 58.7 nano seconds
11. What is the memory consumption for a true color frame buffer
on an XGA display? ("XGA" = 1024 x 768 pixels).
Solution:
True color means 8 bits per color channel (RGB)
Total bits per pixel = 24
Frame Buffer size = Resolution * bits per pixel
= 1024*768*(8*3)