0% found this document useful (0 votes)
20 views45 pages

New Graphic Note

The document provides an overview of computer graphics, explaining key concepts such as pixels, image resolution, and color depth. It discusses the storage and display of images using frame buffers and the operation of cathode ray tubes (CRTs) in video monitors. Additionally, it covers transformations in graphics, applications of computer graphics, data reduction in data mining, and the differences between raster and vector graphics.

Uploaded by

Agaba Agene
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views45 pages

New Graphic Note

The document provides an overview of computer graphics, explaining key concepts such as pixels, image resolution, and color depth. It discusses the storage and display of images using frame buffers and the operation of cathode ray tubes (CRTs) in video monitors. Additionally, it covers transformations in graphics, applications of computer graphics, data reduction in data mining, and the differences between raster and vector graphics.

Uploaded by

Agaba Agene
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

Computer Graphics

Computer graphics generally means creation, storage


and manipulation of models and images.
What is Picture Element (PIXELS)
Pixel is the smallest units of an image that can be processed and displayed on a
digital display. Each pixel represents a dot or a square of color in an image. Each
PIXEL has a dark to light value from 0 (solid black) to 255 (pure white). That is,
there are 256 defined values.

The pixel size is about 0.2 x 0.2mm on conventional displays or even smaller on
high-resolution displays. A typical screen size is about 1024 x 768 pixels.

At its core, 1024 x 768 represents a screen


resolution that consists of 1024 horizontal pixels
and 768 vertical pixels. Ex: If your image
resolution is 1020 x 800(width x height), the
total number of pixels is 816,000.
What is the Resolution of an Image
Image resolution is typically described in PPI, which refers to how many pixels are
displayed per inch of an image. Higher resolutions mean that there more pixels per inch
(PPI), resulting in a high-quality image.

What is PPI resolution? Pixels per inch (PPI) resolutions refers to the number of pixels
(dots) contained within each inch of a digital image. (1 inch = 25.4mm). Generally
speaking, the higher the PPI, the better the image quality.

Example for resolution units:


How are pictures actually stored and displayed?
To store an image on a computer, the image is first broken down into tiny elements
called PIXELS. Now, for the computer to store the image, each pixel is represented by a
binary value. For every pixel, an average color is found and a binary value is assigned.
For monochrome(two-color) image, only 1 bit is needed to represent each pixel. 0 for
white and 1 for black.

The number of bits represent for each pixel color is called color depth or bit depth. If
the color depth of an image is 8-bit, the image contains 256 colors. The most common
color depths you see are 8-bit(2⁸ = 256 colors), 16-bit (2¹⁶ = 65,536 colors) and 24-
bit(2²⁴ = 16.7 million colors).

For example, for an image that uses 4 colors(2² = 4), 2 bits(color depth is 2-bit) are
needed for each pixel. So, in this case, we can have, 00-white; 01-black; 10-yellow; 11-
blue. Similarly, for a color depth of 3, we have 8 colors and we can have, 000-white;
001-black; 010-yellow; 110-blue;
How are pictures actually stored and displayed?
Each screen pixel is represented by a binary value corresponding to a particular entry
in a two-dimensional array residing in memory. This memory is called a frame buffer or
a bit map.

A frame buffer is a crucial component in computer graphics that serves as a storage


area in memory for image data that will be displayed on the screen.

These 0’s and 1’s will be read by display controller one line at a time and sent to the
screen after converting them from digital to analog. The display controller reads the
contents of frame buffer one line at a time or entire digits at time.
The contents of the framebuffer is what is
ultimately transferred to and seen on the
physical display. Therefore it is very common to
have the same pixel width and height of the
framebuffer and the display.
Frame buffer
Each screen pixel corresponding to a particular entry in a two-dimensional array
residing in memory. This memory is called a frame buffer or a bit map.

In figure below, a value of 1 placed in a location in the frame buffer results in


the corresponding (bright) pixel being displayed on the screen.
UNIT – I
OVERVIEW OF GRAPHICS SYSTEM
Visual Display Devices
The primary output device in a graphics system is a video monitor. Although many
technologies exist, but the operation of most video monitors is based on the standard
Cathode Ray Tube (CRT) design.

Cathode Ray Tubes (CRT)

A cathode ray tube (CRT) is a specialized vacuum tube in which images are produced
when an electron beam strikes a phosphorescent surface.

In other Words, the CRT generates the beams, accelerates it at high velocity and
deflect it for creating the images on the phosphorous screen so that the beam
becomes visible.

Most desktop computer displays make use of CRT for image displaying purposes.
Construction of a CRT
It is composed of three main components: an electron gun that emits a stream of
electrons, a deflection system that controls the direction of the electrons, and a
phosphorescent screen that emits light when struck by electrons.

The electron gun consists of a cathode, a heated filament that emits electrons, and a
grid that controls the flow of electrons.

The heat is supplied to the cathode (by passing current through the filament). This way
the electrons get heated up and start getting ejected out of the cathode filament. This
stream of negatively charged electrons is accelerated towards the phosphor screen by
supplying a high positive voltage. This acceleration is generally produced by means of
an accelerating anode.

Next component is the Focusing System, which is used to force the electron beam to
converge to small spot on the screen. If there will not be any focusing system, the
electrons will be scattered because of their own repulsions and hence we won’t get a
sharp image of the object.
Construction of a CRT

The electron beam is directed towards the screen by a deflection system, which uses
electric and magnetic fields to control the path of the electrons. When the **electron
**beam hits the phosphorescent screen, it causes the screen to emit light at the point
of impact, creating a bright dot on the screen.
Construction of a CRT
A cylindrical metal over the cathode is called the Control grid. It is used to control the
intensity of the electron beam by changing its voltage level.

The focusing system is used to converge the electron beam to focus on a small spot
when it sticks the phosphor screen.

Different kinds of phosphors are used in a CRT. The difference is based upon the time
for how long the phosphor continues to emit light after the CRT beam has been
removed. This property is referred to as Persistence.
Types of Deflection:
Cathode Ray Tubes (CRTs) utilize deflection systems to control the path of the electron
beam, enabling precise positioning on the screen. There are two primary types of
deflection systems: electrostatic and magnetic.

Electrostatic Deflection: The electron beam (cathode rays) passes through a highly
positively charged metal cylinder called deflection plates, an electric field is established
between them. As the electron beam passes through this field, it experiences a force
perpendicular to its initial direction, causing it to deflect.
A voltage applied across the Vertical
Plates will deflect the electron beam
vertically. A voltage applied across
the Horizontal Plates will deflect the
electron beam horizontally.
Types of Deflection:

Magnetic Deflection: Current flows through coils positioned around the CRT neck,
generating magnetic fields. According to the Lorentz force law, a moving electron in a
magnetic field experiences a force perpendicular to both its velocity and the magnetic
field direction, resulting in beam deflection.
In a CRT with magnetic
deflection, instead of two pairs of
deflection plates inside the CRT,
there are two pairs of deflection
coils mounted around the neck.
Types of Deflection:

1. Electrostatic Deflection: The electron beam (cathode rays) passes through a highly
positively charged metal cylinder that forms an electrostatic lens. This electrostatic
lens focuses the cathode rays to the center of the screen in the same way like an
optical lens focuses the beam of light. Two pairs of parallel plates are mounted inside
the CRT tube.
Slope-Intercept Line Equation
Line Equation is defined as:
y=mx+b
Where m is the slope of the line, and defined as the
change in y values divided by the change in x
values:
Yend – Ystart
m=
Xend – Xstart
b is the y-intercept. Recall that the y-intercept is the
line’s y value when x equals zero.
For example, the line defined by equation y=5x+3
the y-intercept is b=3. Substitute zero into the equation to get y=3 16
Slope-Intercept Line Equation
The y-intercept can be calculated by the following
equation in terms of the coordinate of the starting
points.
b = Ystart – m Xstart
The y-intercept can also be calculated by the
following equation in terms of the coordinate of the
ending points.
b = Yend – m Xend

17
Simple DDA Line Drawing Algorithm
We will use the simple DDA algorithm to draw a line with
starting point (2,0) and ending point (7,4) on a pixel based
display. Firstly, we compute the slope m:
m =(Yend–Ystart)/(Xend–Xstart)=(4–0)/(7–2)=4/5 = 0.8
y = Ystart = 0 x = Xstart + 1 = 2 + 1 =3
x y Round(y)
2 0
3 y = y + m = 0 + 0.8=0.8 1
4 y = y + m = 0.8 + 0.8=1.6 2
5 y = y + m = 1.6 + 0.8=2.4 2
6 y = y + m = 2.4 + 0.8=3.2 3
7 4
18
• The Cartesian slope intercept eqn for straight
line is y = m x + b (1)

• (x1,y1) & (x2,y2) be the two endpoints of the


line, then m=(y2-y1)/(x2-x1)
b= y1- mx1
(2)
i.e y1 = mx1 + b
y2 = mx2 + b (3)
(3) –(2)

( y2-y1) = m (x2 – x1)


m=(y2-y1)/(x2-x1) ie ∆y/ ∆x
2D Transformation
Introduction To Transformation
One of the most common and important tasks in computer graphics is to
transform (changing) the coordinates (position, orientation, size and shape)
of either object within the graphical scene or the camera that is viewing the
scene.

Types of Transformations

Three basic types of transformations that can perform in two dimensions:

a. Translation (shift OR move).


b. Scaling.
c. Rotation
Introduction To Transformation
One of the most common and important tasks in computer graphics is to
transform (changing) the coordinates (position, orientation, size and shape)
of either object within the graphical scene or the camera that is viewing the
scene.

Types of Transformations

Three basic types of transformations that can perform in two dimensions:

a. Translation (shift OR move).


b. Scaling.
c. Rotation
Translation
Translation is a transformation that moves an object to a different
position on the screen. You can translate a point in 2D by adding translation
coordinate (𝑡𝑥, 𝑡𝑦) to the original coordinate (X, Y) to get the new
coordinate (X’, Y’).

Figure show the translation and Mathematically this can be represented as:

X’= X+ 𝑡𝑥 & Y’= Y + 𝑡𝑦


You can translate a point in 2D by adding
translation coordinate (tx, ty) to the original
coordinate (X, Y) to get the new coordinate (X’, Y’).
Translation
Scaling
To change the size of an object, scaling transformation is used. In the
scaling process, you either expand or compress the dimensions of the
object. Scaling can be achieved by multiplying the original coordinates of
the object with the scaling factor to get the desired result.

Let us assume that the original coordinates are (X, Y), the scaling factors
are (SX, SY), and the produced coordinates are (X’, Y’). This can be
mathematically represented as shown below; X' = X . SX and Y' = Y . SY

The above equations can also be represented in matrix form as below −


Scaling
Difference between 2D and 3D computer graphics
 2D graphics have height and width, and 3D graphics add a layer of
depth which provides an element of realism.

We’ve taken three measurements from this box: length 20 cm, width 10
cm, and height 15 cm.

While length is the longest side of a shape, width is


the shorter side, and height is the vertical dimension
or depth of the shape.
State six areas of application of computer graphics and
describe any three of them

Entertainment: CG methods are now commonly used in making motion


pictures, music videos and television shows. Many TV series regularly
employ computer graphics method. Graphics objects can be combined
with a live.

Education: Computer-generated models are particularly effective for


teaching a wide range of topics and foundations in a simple and easy-to-
understand manner. Many instructional models might made with the help
of this, which can help students become more interesting in this subject.
State six areas of application of computer graphics and
describe any three of them
Scientific Visualization: Scientific visualization refers to the process of
representing raw, scientific data as images, providing an external aid to
improve scientists' interpretations of large data sets and to gain insights
that may be overlooked by statistical methods alone.

Graphical User Interface: It is common now for software packages to


provide a graphical interface. The use of pictures, images, icons, pop-up
menus, and graphical objects helps in creating a user-friendly environment
where working is easy.
State six areas of application of computer graphics and
describe any three of them
Computer-Aided Design (CAD): Computer-aided design (CAD) is used in
fields like architecture, engineering, and manufacturing to create detailed
designs of buildings, products, and mechanical parts. CAD software allows
users to create and manipulate 3D models on a computer before physical
production begins.

Image Processing: Various kinds of photographs or images require editing


in order to be used in different places. Processing of existing images into
refined ones for better interpretation is one of the many applications of
computer graphics. One of the many techniques of computer graphics is
to transform existing images into optimized ones to enhance their
understanding.
Data Reduction in Data Mining

Data reduction is a technique used in data mining to reduce the size of a


dataset while still preserving the most important information. This can be
beneficial in situations where the dataset is too large to be processed
efficiently, or where the dataset contains a large amount of irrelevant or
redundant information.
State two advantages and three disadvantages of data
reduction. Disadvantages:
Loss of information: Data reduction can result in a loss of information, if
important data is removed during the reduction process.

Impact on accuracy: Data reduction can impact the accuracy of a model, as


reducing the size of the dataset can also remove important information that
is needed for accurate predictions.

Impact on interpretability: Data reduction can make it harder to interpret


the results, as removing irrelevant or redundant information can also
remove context that is needed to understand the results.

Additional computational costs: Data reduction can add additional


computational costs to the data mining process, as it requires additional
State two advantages and three disadvantages of data
reduction. Advantages:
Improved efficiency: Data reduction can help to improve the efficiency of
machine learning algorithms by reducing the size of the dataset. This can
make it faster and more practical to work with large datasets.

Improved performance: Data reduction can help to improve the


performance of machine learning algorithms by removing irrelevant or
redundant information from the dataset. This can help to make the model
more accurate and robust.

Reduced storage costs: Data reduction can help to reduce the storage
costs associated with large datasets by reducing the size of the data.
Aspect Ratio
Simply put, aspect ratio is the ratio of the width to the height of an image
or video frame measured in unit length or number of pixels. Represented as
two numbers separated by a colon, it determines the shape of the display
area.

For instance, a 4:3 aspect ratio means the width is four units, and the
height is three units. The primary unit of measurement for aspect ratios is
pixels, but they can be measured in other units such as feet, meters, LED
panels, or square (1:1) widgets.
Difference between Raster and Vector Graphics
What is OCR (Optical Character Recognition)?

Optical Character Recognition (OCR) is the process that converts an image


of text into a machine-readable text format. For example, if you scan a form
or a receipt, your computer saves the scan as an image file. You cannot use
a text editor to edit, search, or count the words in the image file. However,
you can use OCR to convert the image into a text document with its
contents stored as text data.
3D Shearing Transformation

Shearing is the process of slanting an object in 3D space either in x, y, or


in the z-direction.

In a three-dimensional plane, the object size can be change along the x


direction, y-direction as well as z-direction.
So there are three versions of shearing:
1. Shearing in x axis
2. Shearing in y axis
3. Shearing in z axis
What is rendering

The term rendering defines the automatic process of generating digital


images from three-dimensional models, by means of a special software.
What is modelling
Modelling refers to physical, mathematical, or logical representation of a of
a real-world system or process.

What is simulations

Simulation involves executing a model over time to study how it behaves


under various conditions. It often uses computational methods to run the
model and observe outcomes, mimicking the operation of the real system.

What is animation

Animation involves creating moving images through the use of computer


graphics.
Sheet
1. What is the resolution of an image? The number of pixels per unit length
in horizontal as well as vertical direction.

2. Compute the size of a 640 X 480 image at 240 pixels per inch.

3. Compute the resolution a 2 X 2 inch image that has 512 X 512 pixels

You might also like