0% found this document useful (0 votes)
11 views31 pages

UNIT 3 - Line - Generation

The document discusses various algorithms for line and circle generation in computer graphics, focusing on the DDA and Bresenham line drawing algorithms. It outlines the procedures for each algorithm, including step-by-step calculations and practice problems to illustrate their application. Additionally, it highlights the advantages and disadvantages of each algorithm, as well as introduces a parametric circle generating algorithm.
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)
11 views31 pages

UNIT 3 - Line - Generation

The document discusses various algorithms for line and circle generation in computer graphics, focusing on the DDA and Bresenham line drawing algorithms. It outlines the procedures for each algorithm, including step-by-step calculations and practice problems to illustrate their application. Additionally, it highlights the advantages and disadvantages of each algorithm, as well as introduces a parametric circle generating algorithm.
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/ 31

COMPUTER GRAPHICS [TYBCA – SEM6]

UNIT 3. – LINE GENERATION


3.1 Line drawing algorithm

3.1.1 DDL Line Generation algorithm

3.1.2. Bresenham Line Generation algorithm

3.2 Circle Generation Algorithm

3.2.2 Parametric Circle Generating Algorithm

3.2.2 Bresenham Circle Generating Algorithm

3.3 Line Style

3.3.1 Thick line

3.3.2 Line Caps and Joint

3.4 Anti-aliasing of line

3.1 DDA (Digital Differential Analyzer) Line Generation Algorithm:


DDA Algorithm is the simplest line drawing algorithm.

Given the starting and ending coordinates of a line,


DDA Algorithm attempts to generate the points between the starting and ending
coordinates.

Procedure-
Given-
 Starting coordinates = (X0, Y0)
 Ending coordinates = (Xn, Yn)

The points generation using DDA Algorithm involves the following steps-
Step-01:

Calculate ΔX, ΔY and M from the given input.


These parameters are calculated as-
CREATED BY : KRUPA PATEL
1
COMPUTER GRAPHICS [TYBCA – SEM6]
 ΔX = Xn – X0
 ΔY =Yn – Y0
 M = ΔY / ΔX
Step-02:

Find the number of steps or points in between the starting and ending coordinates.
if (absolute (ΔX) > absolute (ΔY))
Steps = absolute (ΔX);
else
Steps = absolute (ΔY);
Step-03:

Suppose the current point is (Xp, Yp) and the next point is (Xp+1, Yp+1).
Find the next point by following the below three cases-

Step-04:
Keep repeating Step-03 until the end point is reached or the number of generated new points
(including the starting and ending points) equals to the steps count.

CREATED BY : KRUPA PATEL


2
COMPUTER GRAPHICS [TYBCA – SEM6]

PRACTICE PROBLEMS BASED ON DDA ALGORITHM-


Problem-01:

Calculate the points between the starting point (5, 6) and ending point (8, 12).
Solution-
Given-
 Starting coordinates = (X0, Y0) = (5, 6)
 Ending coordinates = (Xn, Yn) = (8, 12)

Step-01:
Calculate ΔX, ΔY and M from the given input.
 ΔX = Xn – X0 = 8 – 5 = 3
 ΔY =Yn – Y0 = 12 – 6 = 6
 M = ΔY / ΔX = 6 / 3 = 2

Step-02:
Calculate the number of steps.
As |ΔX| < |ΔY| = 3 < 6, so number of steps = ΔY = 6

Step-03:
As M > 1, so case-03 is satisfied.
Now, Step-03 is executed until Step-04 is satisfied.

Xp Yp Xp+1 Yp+1 Round off


(Xp+1, Yp+1)

5 6 5.5 7 (6, 7)

6 8 (6, 8)

6.5 9 (7, 9)

CREATED BY : KRUPA PATEL


3
COMPUTER GRAPHICS [TYBCA – SEM6]

7 10 (7, 10)

7.5 11 (8, 11)

8 12 (8, 12)

Problem-02:
Calculate the points between the starting point (5, 6) and ending point (13, 10).

Solution-
Given-
 Starting coordinates = (X0, Y0) = (5, 6)
 Ending coordinates = (Xn, Yn) = (13, 10)

Step-01:

Calculate ΔX, ΔY and M from the given input.


 ΔX = Xn – X0 = 13 – 5 = 8
 ΔY =Yn – Y0 = 10 – 6 = 4
 M = ΔY / ΔX = 4 / 8 = 0.50

Step-02:

Calculate the number of steps.


As |ΔX| > |ΔY| = 8 > 4, so number of steps = ΔX = 8

Step-03:

As M < 1, so case-01 is satisfied.


Now, Step-03 is executed until Step-04 is satisfied.
Xp Yp Xp+1 Yp+1 Round off
(Xp+1, Yp+1)
5 6 6 6.5 (6, 7)
7 7 (7, 7)

CREATED BY : KRUPA PATEL


4
COMPUTER GRAPHICS [TYBCA – SEM6]
8 7.5 (8, 8)
9 8 (9, 8)
10 8.5 (10, 9)
11 9 (11, 9)
12 9.5 (12, 10)
13 10 (13, 10)

Problem-03:
Calculate the points between the starting point (1, 7) and ending point (11, 17).

Solution-
Given-
 Starting coordinates = (X0, Y0) = (1, 7)
 Ending coordinates = (Xn, Yn) = (11, 17)

Step-01:
Calculate ΔX, ΔY and M from the given input.
 ΔX = Xn – X0 = 11 – 1 = 10
 ΔY =Yn – Y0 = 17 – 7 = 10
 M = ΔY / ΔX = 10 / 10 = 1

Step-02:
Calculate the number of steps.
As |ΔX| = |ΔY| = 10 = 10, so number of steps = ΔX = ΔY = 10

Step-03:
As M = 1, so case-02 is satisfied.
Now, Step-03 is executed until Step-04 is satisfied.
Xp Yp Xp+1 Yp+1 Round off
(Xp+1, Yp+1)
1 7 2 8 (2, 8)
3 9 (3, 9)
4 10 (4, 10)

CREATED BY : KRUPA PATEL


5
COMPUTER GRAPHICS [TYBCA – SEM6]
5 11 (5, 11)
6 12 (6, 12)
7 13 (7, 13)
8 14 (8, 14)
9 15 (9, 15)
10 16 (10, 16)
11 17 (11, 17)

Advantages of DDA Algorithm-

The advantages of DDA Algorithm are-


 It is a simple algorithm.
 It is easy to implement.
 It avoids using the multiplication operation which is costly in terms of time complexity.

Disadvantages of DDA Algorithm-

The disadvantages of DDA Algorithm are-


 There is an extra overhead of using round off( ) function.
 Using round off ( ) function increases time complexity of the algorithm.
 Resulted lines are not smooth because of round off( ) function.
 The points generated by this algorithm are not accurate.

3.1.2 Bresenham Line Drawing Algorithm-

Given the starting and ending coordinates of a line,


Bresenham Line Drawing Algorithm attempts to generate the points between the
starting and ending coordinates.

CREATED BY : KRUPA PATEL


6
COMPUTER GRAPHICS [TYBCA – SEM6]

Procedure-
Given-
 Starting coordinates = (X0, Y0)
 Ending coordinates = (Xn, Yn)

The points generation using Bresenham Line Drawing Algorithm involves the following steps-
Step-01:
Calculate ΔX and ΔY from the given input.
These parameters are calculated as-
 ΔX = Xn – X0
 ΔY =Yn – Y0

Step-02:
Calculate the decision parameter Pk.
It is calculated as-
Pk = 2ΔY – ΔX
Step-03:
Suppose the current point is (Xk, Yk) and the next point is (Xk+1, Yk+1).
Find the next point depending on the value of decision parameter Pk.
Follow the below two cases-

CREATED BY : KRUPA PATEL


7
COMPUTER GRAPHICS [TYBCA – SEM6]

Step-04:

Keep repeating Step-03 until the end point is reached or number of iterations equals to (ΔX-1)
times.

PRACTICE PROBLEMS BASED ON BRESENHAM LINE DRAWING


ALGORITHM-

Problem-01:
Calculate the points between the starting coordinates (9, 18) and ending coordinates (14, 22).

Solution-
Given-
 Starting coordinates = (X0, Y0) = (9, 18)
 Ending coordinates = (Xn, Yn) = (14, 22)

Step-01:

Calculate ΔX and ΔY from the given input.


 ΔX = Xn – X0 = 14 – 9 = 5
 ΔY =Yn – Y0 = 22 – 18 = 4

CREATED BY : KRUPA PATEL


8
COMPUTER GRAPHICS [TYBCA – SEM6]
Step-02:

Calculate the decision parameter.


Pk
= 2ΔY – ΔX
=2x4–5
=3
So, decision parameter Pk = 3

Step-03:

As Pk >= 0, so case-02 is satisfied.

Thus,
 Pk+1 = Pk + 2ΔY – 2ΔX = 3 + (2 x 4) – (2 x 5) = 1
 Xk+1 = Xk + 1 = 9 + 1 = 10
 Yk+1 = Yk + 1 = 18 + 1 = 19

Similarly, Step-03 is executed until the end point is reached or number of iterations equals to 4
times.
(Number of iterations = ΔX – 1 = 5 – 1 = 4)

Pk Pk+1 Xk+1 Yk+1

9 18

3 1 10 19

1 -1 11 20

-1 7 12 20

7 5 13 21

5 3 14 22

CREATED BY : KRUPA PATEL


9
COMPUTER GRAPHICS [TYBCA – SEM6]
Problem-02:
Calculate the points between the starting coordinates (20, 10) and ending coordinates (30, 18).
Solution-
Given-
 Starting coordinates = (X0, Y0) = (20, 10)
 Ending coordinates = (Xn, Yn) = (30, 18)

Step-01:

Calculate ΔX and ΔY from the given input.


 ΔX = Xn – X0 = 30 – 20 = 10
 ΔY =Yn – Y0 = 18 – 10 = 8

Step-02:

Calculate the decision parameter.


Pk = 2ΔY – ΔX
= 2 x 8 – 10
=6
So, decision parameter Pk = 6

Step-03:
As Pk >= 0, so case-02 is satisfied.
Thus,
 Pk+1 = Pk + 2ΔY – 2ΔX = 6 + (2 x 8) – (2 x 10) = 2
 Xk+1 = Xk + 1 = 20 + 1 = 21
 Yk+1 = Yk + 1 = 10 + 1 = 11

Similarly, Step-03 is executed until the end point is reached or number of iterations equals to 9
times.
(Number of iterations = ΔX – 1 = 10 – 1 = 9)

CREATED BY : KRUPA PATEL


10
COMPUTER GRAPHICS [TYBCA – SEM6]
Pk Pk+1 Xk+1 Yk+1
20 10
6 2 21 11
2 -2 22 12
-2 14 23 12
14 10 24 13
10 6 25 14
6 2 26 15
2 -2 27 16
-2 14 28 16
14 10 29 17
10 6 30 18

CREATED BY : KRUPA PATEL


11
COMPUTER GRAPHICS [TYBCA – SEM6]

Advantages of Bresenham Line Drawing Algorithm-

The advantages of Bresenham Line Drawing Algorithm are-


 It is easy to implement.
 It is fast and incremental.
 It executes fast but less faster than DDA Algorithm.
 The points generated by this algorithm are more accurate than DDA Algorithm.
 It uses fixed points only.

Disadvantages of Bresenham Line Drawing Algorithm-

The disadvantages of Bresenham Line Drawing Algorithm are-


 Though it improves the accuracy of generated points but still the resulted line is not
smooth.
 This algorithm is for the basic line drawing.
 It can not handle diminishing jaggies.

3.2 Circle Generation Algorithm

3.2.1 Parametric Circle Generating Algorithm

A parametric equation is a mathematical equation expressing the coordinates of the points


of a curve as functions of one or more parameters. In the case of a circle, we can use
parametric equations to generate the points on the circle.

The parametric equations for a circle with center (h, k) and radius r are:

Where:
 (x,y) are the coordinates of a point on the circle.
CREATED BY : KRUPA PATEL
12
COMPUTER GRAPHICS [TYBCA – SEM6]
 (h,k) are the coordinates of the center of the circle.
 r is the radius of the circle.
 θ is the parameter, typically ranging from 0 to 2π (or 0 to 360 degrees).
Algorithm:
Input: Center coordinates (h, k), radius r

Output: List of points on the circumference of the circle

Step 1: Define Parameters

- Set (h, k) as the center coordinates of the circle

- Set r as the radius of the circle

Step 2: Generate Parameter Values

- Choose a range of values for theta (e.g., from 0 to 2π)

- Choose the number of points to generate

Step 3: Calculate Points

- For each value of theta:

- Calculate x = h + r * cos(theta)

- Calculate y = k + r * sin(theta)

- Store (x, y) as a point on the circle

Step 4: Repeat

- Repeat Step 3 for each value of theta until desired granularity is achieved

Step 5: Output

- Return the list of points on the circumference of the circle

Implementing these steps in code (like the Python example) will generate the
desired circle. Adjusting the number of points generated will affect the
granularity or smoothness of the circle. More points will result in a smoother
circle but will also require more computational resources.
CREATED BY : KRUPA PATEL
13
COMPUTER GRAPHICS [TYBCA – SEM6]

CREATED BY : KRUPA PATEL


14
COMPUTER GRAPHICS [TYBCA – SEM6]

Example :

Let's generate a table showing the calculation of points on the circumference of a circle with a
center at (10, 10) and a radius of 3. We'll generate 10 points for demonstration purposes.

CREATED BY : KRUPA PATEL


15
COMPUTER GRAPHICS [TYBCA – SEM6]

You can continue this process to calculate the coordinates for each point on the circumference of
the circle.

CREATED BY : KRUPA PATEL


16
COMPUTER GRAPHICS [TYBCA – SEM6]

3.2.2 Bresenham Circle Drawing Algorithm-

Given the center point and radius of circle,


Bresenham Circle Drawing Algorithm attempts to generate the points of one octant.

The points for other octants are generated using the eight symmetry property.

Procedure-
Given-
 Centre point of Circle = (X0, Y0)
 Radius of Circle = R

The points generation using Bresenham Circle Drawing Algorithm involves the following steps-

CREATED BY : KRUPA PATEL


17
COMPUTER GRAPHICS [TYBCA – SEM6]

Step-01:
Assign the starting point coordinates (X0, Y0) as-
 X0 = 0
 Y0 = R
Step-02:
Calculate the value of initial decision parameter P0 as-
P0 = 3 – 2 x R
Step-03:
Suppose the current point is (Xk, Yk) and the next point is (Xk+1, Yk+1).
Find the next point of the first octant depending on the value of decision parameter Pk.
Follow the below two cases-

Step-04:
If the given centre point (X0, Y0) is not (0, 0), then do the following and plot the point-
 Xplot = Xc + X0
 Yplot = Yc + Y0
Here, (Xc, Yc) denotes the current value of X and Y coordinates.

Step-05:
Keep repeating Step-03 and Step-04 until Xplot => Yplot.

Step-06:

CREATED BY : KRUPA PATEL


18
COMPUTER GRAPHICS [TYBCA – SEM6]
Step-05 generates all the points for one octant.
To find the points for other seven octants, follow the eight symmetry property of circle.
This is depicted by the following figure-

PRACTICE PROBLEMS BASED ON BRESENHAM


CIRCLE DRAWING ALGORITHM-

Problem-01:

Given the centre point coordinates (0, 0) and radius as 8, generate all the points to form a
circle.

Solution-

Given-
 Centre Coordinates of Circle (X0, Y0) = (0, 0)
 Radius of Circle = 8

Step-01:

Assign the starting point coordinates (X0, Y0) as-


 X0 = 0
 Y0 = R = 8

Step-02:

Calculate the value of initial decision parameter P0 as-


P0 = 3 – 2 x R
P0 = 3 – 2 x 8
P0 = -13

CREATED BY : KRUPA PATEL


19
COMPUTER GRAPHICS [TYBCA – SEM6]

Step-03:

As Pinitial < 0, so case-01 is satisfied.

Thus,
 Xk+1 = Xk + 1 = 0 + 1 = 1
 Yk+1 = Yk = 8
 Pk+1 = Pk + 4 x Xk+1 + 6 = -13 + (4 x 1) + 6 = -3

Step-04:

This step is not applicable here as the given centre point coordinates is (0, 0).

Step-05:

Step-03 is executed similarly until Xk+1 >= Yk+1 as follows-

Pk Pk+1 (Xk+1, Yk+1)

(0, 8)

-13 -3 (1, 8)

-3 11 (2, 8)

11 5 (3, 7)

5 7 (4, 6)

7 (5, 5)

Algorithm Terminates
These are all points for Octant-1.

Algorithm calculates all the points of octant-1 and terminates.

CREATED BY : KRUPA PATEL


20
COMPUTER GRAPHICS [TYBCA – SEM6]

Now, the points of octant-2 are obtained using the mirror effect by swapping X and Y
coordinates.

Octant-1 Points Octant-2 Points

(0, 8) (5, 5)

(1, 8) (6, 4)

(2, 8) (7, 3)

(3, 7) (8, 2)

(4, 6) (8, 1)

(5, 5) (8, 0)

These are all points for Quadrant-1.

Now, the points for rest of the part are generated by following the signs of other quadrants.
The other points can also be generated by calculating each octant separately.

Here, all the points have been generated with respect to quadrant-1-

Quadrant-1 (X,Y) Quadrant-2 (-X,Y) Quadrant-3 (-X,-Y) Quadrant-4 (X,-Y)

(0, 8) (0, 8) (0, -8) (0, -8)

(1, 8) (-1, 8) (-1, -8) (1, -8)

(2, 8) (-2, 8) (-2, -8) (2, -8)

(3, 7) (-3, 7) (-3, -7) (3, -7)

(4, 6) (-4, 6) (-4, -6) (4, -6)

(5, 5) (-5, 5) (-5, -5) (5, -5)

(6, 4) (-6, 4) (-6, -4) (6, -4)

(7, 3) (-7, 3) (-7, -3) (7, -3)

CREATED BY : KRUPA PATEL


21
COMPUTER GRAPHICS [TYBCA – SEM6]

(8, 2) (-8, 2) (-8, -2) (8, -2)

(8, 1) (-8, 1) (-8, -1) (8, -1)

(8, 0) (-8, 0) (-8, 0) (8, 0)

These are all points of the Circle.

Problem-02:

Given the centre point coordinates (10, 10) and radius as 10, generate all the points to form a
circle.

Solution-
Given-
 Centre Coordinates of Circle (X0, Y0) = (10, 10)
 Radius of Circle = 10

Step-01:

Assign the starting point coordinates (X0, Y0) as-


 X0 = 0
 Y0 = R = 10

Step-02:

Calculate the value of initial decision parameter P0 as-


P0 = 3 – 2 x R
P0 = 3 – 2 x 10
P0 = -17

CREATED BY : KRUPA PATEL


22
COMPUTER GRAPHICS [TYBCA – SEM6]
Step-03:

As Pinitial < 0, so case-01 is satisfied.

Thus,
 Xk+1 = Xk + 1 = 0 + 1 = 1
 Yk+1 = Yk = 10
 Pk+1 = Pk + 4 x Xk+1 + 6 = -17 + (4 x 1) + 6 = -7

Step-04:

This step is applicable here as the given centre point coordinates is (10, 10).

Xplot = Xc + X0 = 1 + 10 = 11
Yplot = Yc + Y0 = 10 + 10 = 20

Step-05:
Step-03 and Step-04 are executed similarly until Xplot >= Yplot as follows-

Pk Pk+1 (Xk+1, Yk+1) (Xplot, Yplot)

(0, 10) (10, 20)

-17 -7 (1, 10) (11, 20)

-7 7 (2, 10) (12, 20)

7 -7 (3, 9) (13, 19)

-7 15 (4, 9) (14, 19)

15 13 (5, 8) (15, 18)

13 19 (6, 7) (16, 17)

Algorithm Terminates
These are all points for Octant-1.

Algorithm calculates all the points of octant-1 and terminates.

CREATED BY : KRUPA PATEL


23
COMPUTER GRAPHICS [TYBCA – SEM6]
Now, the points of octant-2 are obtained using the mirror effect by swapping X and Y
coordinates.

Octant-1 Points Octant-2 Points

(10, 20) (17, 16)

(11, 20) (18, 15)

(12, 20) (19, 14)

(13, 19) (19, 13)

(14, 19) (20, 12)

(15, 18) (20, 11)

(16, 17) (20, 10)

These are all points for Quadrant-1.

Now, the points for rest of the part are generated by following the signs of other quadrants.
The other points can also be generated by calculating each octant separately.

Here, all the points have been generated with respect to quadrant-1-

Quadrant-1 (X,Y) Quadrant-2 (-X,Y) Quadrant-3 (-X,-Y) Quadrant-4 (X,-Y)

(10, 20) (10, 20) (10, 0) (10, 0)

(11, 20) (9, 20) (9, 0) (11, 0)

(12, 20) (8, 20) (8, 0) (12, 0)

(13, 19) (7, 19) (7, 1) (13, 1)

(14, 19) (6, 19) (6, 1) (14, 1)

(15, 18) (5, 18) (5, 2) (15, 2)

(16, 17) (4, 17) (4, 3) (16, 3)

(17, 16) (3, 16) (3, 4) (17, 4)

CREATED BY : KRUPA PATEL


24
COMPUTER GRAPHICS [TYBCA – SEM6]

(18, 15) (2, 15) (2, 5) (18, 5)

(19, 14) (1, 14) (1, 6) (19, 6)

(19, 13) (1, 13) (1, 7) (19, 7)

(20, 12) (0, 12) (0, 8) (20, 8)

(20, 11) (0, 11) (0, 9) (20, 9)

(20, 10) (0, 10) (0, 10) (20, 10)

These are all points of the Circle.

Advantages of Bresenham Circle Drawing Algorithm-

The advantages of Bresenham Circle Drawing Algorithm are-


 The entire algorithm is based on the simple equation of circle X2 + Y2 = R2.
 It is easy to implement.

Disadvantages of Bresenham Circle Drawing Algorithm-

The disadvantages of Bresenham Circle Drawing Algorithm are-


 accuracy of the generating points is an issue in this algorithm.
 This algorithm suffers when used to generate complex and high graphical images.
 There is no significant enhancement with respect to performance.

CREATED BY : KRUPA PATEL


25
COMPUTER GRAPHICS [TYBCA – SEM6]

3.3 Line Style

CREATED BY : KRUPA PATEL


26
COMPUTER GRAPHICS [TYBCA – SEM6]

CREATED BY : KRUPA PATEL


27
COMPUTER GRAPHICS [TYBCA – SEM6]

The basic attribute of straight line are its type, width and color.

Line Type:

1. Solid Line _____________


2. Dash Line - - - - - - - - - - - -
3. Dotted Line . . . . . . . . . . . . .
4. Dash Dotted Line_._._._._._.

Dash Line:

A dashed line could be displayed by generating an inter dash spacing that is equal to the length
of the solid section.

Both the length of dashes and the inter dash spacing are often specified as user option.

Dotted Line:

A dotted line can be displayed by generating very short dashes with spacing equal to or greater
than the dash size.

Dash Dotted:

Combination of the earlier two.

CREATED BY : KRUPA PATEL


28
COMPUTER GRAPHICS [TYBCA – SEM6]
To set Line-type attribute in graphics application program, a user invokes the function,

setLinetype(It)

Where It is assigned a positive integer value of 1,2,3,4 to generate lines that are respectively
solid, dashed, dotted or dash-dotted.

To set Line-width

SetLinewidthScaleFactor(lw)

Where lw is a positive number to indicate width of line. 1 specifies a standard width line on.

Thicker line can be produced by-

 Adding extra pixel horizontally when |m| >1


 Adding extra pixel vertically when |m| <1

Line Cap

The shape of line ends to give them a better appearance by adding line caps.

There are three types of line cap. They are

 Butt cap
 Round cap
 Projecting square cap

Butt cap is obtained by adjusting the end positions of the component parallel lines so that the thick line
is displayed with square ends that is perpendicular to the line path.

Round cap is obtained by adding a filled semicircle to each butt cap.

Projecting square cap is the extend line and add butt caps that are positioned one-half of the line width
beyond the specified endpoints

Line Joins:
CREATED BY : KRUPA PATEL
29
COMPUTER GRAPHICS [TYBCA – SEM6]

We can generate thick polylines that are smoothly joined at the cost of additional processing at the
segment endpoints.

There are following types of join:

1) A miter join is accomplished by extending the outer boundaries of each of the two lines until they
meet.
2) A round join is produced by capping the connection between the two segments with a circular
boundary whose diameter is equal to the linewidth. And
3) a bevel join is generated by displaying the line segments with butt caps and filling in the triangular
gap where the segments meet.

Aliasing:

In rasterized display devices bitmap method is used. In this bitmap method, array of individual pixels is used.
These pixels have some shape and dimensions too. When a line segment of an image is enlarged, zaggy
boundaries are shown. This type of effect is an error in line segment or image. This error is called aliasing.

There are following most common type of aliasing effects.

1. Zagged profile
 Most known and probable effect

CREATED BY : KRUPA PATEL


30
COMPUTER GRAPHICS [TYBCA – SEM6]
 When sometimes many small images are rendered, some of image components of image
are completely missed or in some cases some of the components lose called improperly
rendered details.
2. Disappeared or improper line details
3. Disintegrating texture.
 Many times when texture is used in the image, this texture is distorted at a distance. When
texture is damaged, the error occurred is called disintegrating type of aliasing.

In general, the distortions due to aliasing error affect the smoothness of the image. This effect becomes
more prominent and remarkable when low resolution of display device is used or high contrast is used for
the image.

Anti-Aliasing:
The process of removing aliasing error is called anti-aliasing. In other word, process of making
image boundary smoother.

Anti-aliasing is a process by which a thin layer layer of pixels around the outer edges of an image is
created in order to make the edge smoother.

Activating a few pixels around the edge which eventually blend into the background colour
gradually going away from the image boundary shows anti-aliased images.

There are following types of anti-aliasing techniques used in computer graphics :

1. Point Sampling theory


2. Super Sampling Method
3. Measure Theory
4. Font Rasterization
5. Color Theory
6. Reconstruction Filter etc.

CREATED BY : KRUPA PATEL


31

You might also like