SlideShare a Scribd company logo
1 of 12
Raster Scan Graphics
Presented by
Asst. Prof. Aparna Joshi
Rasterization
• The process of determining which pixel will
provide the best approximation to the desired
line is known as ‘Rasterization’.
Characteristics of Line Drawing Algorithm
• The line should appear straight.
• Displayed line should have constant brightness
along their length.
• The line should be start and end accurately.
• Lines should have constant density,.
• Line density should be independent of line
length and angle.
• Lines should be drawn rapidly.
DDA Line Drawing Algorithm
1. Read the line end points (x1, y1) & (x2, y2) such
that they are not equal. (If equal then plot
that single point and exit) .
2. Approximate the line length,
If absolute (x2-x1) >= absolute (y2-y1)
then length = absolute (x2-x1)
else length = absolute (y2-y1)
3.
DDA Line Drawing Algorithm
4. Using the sign function, make the algorithm work in all quadrant
x = x1+0.5 * sign ( ∆x)
y = y1 + 0.5 * sign (y)
Here, x1 & y1 are initial values.
5. Begin main loop
i = 1
while (i < = length)
{
plot (integer (x), Integer (y))
x= x+x
y = y+y
i = i + 1
} end while
6. Finish / Stop
DDA Line Drawing Algorithm
Advantages:
• It is the simplest algorithm & it does not require special skills for
implementation.
• It is a faster method for calculating pixel positions than the direct
use of equation y = m.x + b
• It eliminates the multiplication in the equation by making use of
raster characteristics, so that appropriate increments are applied in
the x or y direction to find the pixel positions along the line path.
• It is very easy to understand and implement.
Disadvantages:
• Floating point arithmetic in DDA algorithm is still time-consuming.
• The algorithm is orientation dependent. Hence end point accuracy is
poor.
• It drifts away from the actual line path because of rounding off float
values into integer.
Bresenham’s Line Drawing Algorithm
Circle Drawing Algorithm
Eight-way Symmetry of a Circle
Bresenham’s Circle Drawing Algorithm
Midpoint Circle Algorithm
Thank You

More Related Content

What's hot

Hidden surface removal
Hidden surface removalHidden surface removal
Hidden surface removal
Ankit Garg
 
Polygon Fill
Polygon FillPolygon Fill
Polygon Fill
wahab13
 
Two dimensional geometric transformations
Two dimensional geometric transformationsTwo dimensional geometric transformations
Two dimensional geometric transformations
Mohammad Sadiq
 
Line drawing algo.
Line drawing algo.Line drawing algo.
Line drawing algo.
Mohd Arif
 

What's hot (20)

Hidden surface removal
Hidden surface removalHidden surface removal
Hidden surface removal
 
BRESENHAM’S LINE DRAWING ALGORITHM
BRESENHAM’S  LINE DRAWING ALGORITHMBRESENHAM’S  LINE DRAWING ALGORITHM
BRESENHAM’S LINE DRAWING ALGORITHM
 
Clipping
ClippingClipping
Clipping
 
Computer Graphic - Transformations in 2D
Computer Graphic - Transformations in 2DComputer Graphic - Transformations in 2D
Computer Graphic - Transformations in 2D
 
Cohen and Sutherland Algorithm for 7-8 marks
Cohen and Sutherland Algorithm for 7-8 marksCohen and Sutherland Algorithm for 7-8 marks
Cohen and Sutherland Algorithm for 7-8 marks
 
Computer graphics curves and surfaces (1)
Computer graphics curves and surfaces (1)Computer graphics curves and surfaces (1)
Computer graphics curves and surfaces (1)
 
Computer Graphic - Lines, Circles and Ellipse
Computer Graphic - Lines, Circles and EllipseComputer Graphic - Lines, Circles and Ellipse
Computer Graphic - Lines, Circles and Ellipse
 
raster algorithm.pdf
raster algorithm.pdfraster algorithm.pdf
raster algorithm.pdf
 
Polygon Fill
Polygon FillPolygon Fill
Polygon Fill
 
Two dimensional geometric transformations
Two dimensional geometric transformationsTwo dimensional geometric transformations
Two dimensional geometric transformations
 
Cohen sutherland line clipping
Cohen sutherland line clippingCohen sutherland line clipping
Cohen sutherland line clipping
 
Attributes of output primitive(line attributes)
Attributes of output primitive(line attributes)Attributes of output primitive(line attributes)
Attributes of output primitive(line attributes)
 
Projection In Computer Graphics
Projection In Computer GraphicsProjection In Computer Graphics
Projection In Computer Graphics
 
Random scan displays and raster scan displays
Random scan displays and raster scan displaysRandom scan displays and raster scan displays
Random scan displays and raster scan displays
 
Lecture+ +raster+&+random+scan+systems
Lecture+ +raster+&+random+scan+systemsLecture+ +raster+&+random+scan+systems
Lecture+ +raster+&+random+scan+systems
 
Polygon filling algorithm
Polygon filling algorithmPolygon filling algorithm
Polygon filling algorithm
 
Computer graphics - bresenham line drawing algorithm
Computer graphics - bresenham line drawing algorithmComputer graphics - bresenham line drawing algorithm
Computer graphics - bresenham line drawing algorithm
 
Line drawing algo.
Line drawing algo.Line drawing algo.
Line drawing algo.
 
Computer graphics chapter 4
Computer graphics chapter 4Computer graphics chapter 4
Computer graphics chapter 4
 
Curves and surfaces
Curves and surfacesCurves and surfaces
Curves and surfaces
 

Similar to Raster Scan Graphics, Line Drawing Algorithm and Circle Drawing Algorithm

Bresenham circlesandpolygons
Bresenham circlesandpolygonsBresenham circlesandpolygons
Bresenham circlesandpolygons
aa11bb11
 
Open GL T0074 56 sm3
Open GL T0074 56 sm3Open GL T0074 56 sm3
Open GL T0074 56 sm3
Roziq Bahtiar
 
Lec02 03 rasterization
Lec02 03 rasterizationLec02 03 rasterization
Lec02 03 rasterization
Maaz Rizwan
 
chapter 3 , foley.pptxhuujjjjjjjkjmmmm. Ibibhvucufucuvivihohi
chapter 3 , foley.pptxhuujjjjjjjkjmmmm.  Ibibhvucufucuvivihohichapter 3 , foley.pptxhuujjjjjjjkjmmmm.  Ibibhvucufucuvivihohi
chapter 3 , foley.pptxhuujjjjjjjkjmmmm. Ibibhvucufucuvivihohi
54MahakBansal
 

Similar to Raster Scan Graphics, Line Drawing Algorithm and Circle Drawing Algorithm (20)

DDA-line-drawing-algorithm.pptx
DDA-line-drawing-algorithm.pptxDDA-line-drawing-algorithm.pptx
DDA-line-drawing-algorithm.pptx
 
4 CG_U1_M3_PPT_4 DDA.pptx
4 CG_U1_M3_PPT_4 DDA.pptx4 CG_U1_M3_PPT_4 DDA.pptx
4 CG_U1_M3_PPT_4 DDA.pptx
 
Line drawing Algorithm DDA in computer Graphics.pdf
Line drawing Algorithm DDA in computer Graphics.pdfLine drawing Algorithm DDA in computer Graphics.pdf
Line drawing Algorithm DDA in computer Graphics.pdf
 
1536 graphics &amp; graphical programming
1536 graphics &amp; graphical  programming1536 graphics &amp; graphical  programming
1536 graphics &amp; graphical programming
 
Computer Graphics - Introduction in Brief By: Prof. Manisha Waghmare- Butkar
Computer Graphics - Introduction in Brief By: Prof. Manisha Waghmare- ButkarComputer Graphics - Introduction in Brief By: Prof. Manisha Waghmare- Butkar
Computer Graphics - Introduction in Brief By: Prof. Manisha Waghmare- Butkar
 
Bresenham circlesandpolygons
Bresenham circlesandpolygonsBresenham circlesandpolygons
Bresenham circlesandpolygons
 
Bresenham circles and polygons derication
Bresenham circles and polygons dericationBresenham circles and polygons derication
Bresenham circles and polygons derication
 
cgrchapter2version-1-200729063505 (1).pdf
cgrchapter2version-1-200729063505 (1).pdfcgrchapter2version-1-200729063505 (1).pdf
cgrchapter2version-1-200729063505 (1).pdf
 
Line Drawing Algorithms - Computer Graphics - Notes
Line Drawing Algorithms - Computer Graphics - NotesLine Drawing Algorithms - Computer Graphics - Notes
Line Drawing Algorithms - Computer Graphics - Notes
 
Open GL T0074 56 sm3
Open GL T0074 56 sm3Open GL T0074 56 sm3
Open GL T0074 56 sm3
 
03.Scan Conversion.ppt
03.Scan Conversion.ppt03.Scan Conversion.ppt
03.Scan Conversion.ppt
 
Digital Differential Analyzer Line Drawing Algorithm
Digital Differential Analyzer Line Drawing AlgorithmDigital Differential Analyzer Line Drawing Algorithm
Digital Differential Analyzer Line Drawing Algorithm
 
Computer Graphics Unit 1
Computer Graphics Unit 1Computer Graphics Unit 1
Computer Graphics Unit 1
 
Computer graphics lab manual
Computer graphics lab manualComputer graphics lab manual
Computer graphics lab manual
 
Lec02 03 rasterization
Lec02 03 rasterizationLec02 03 rasterization
Lec02 03 rasterization
 
Lec02 03 rasterization
Lec02 03 rasterizationLec02 03 rasterization
Lec02 03 rasterization
 
chapter 3 , foley.pptxhuujjjjjjjkjmmmm. Ibibhvucufucuvivihohi
chapter 3 , foley.pptxhuujjjjjjjkjmmmm.  Ibibhvucufucuvivihohichapter 3 , foley.pptxhuujjjjjjjkjmmmm.  Ibibhvucufucuvivihohi
chapter 3 , foley.pptxhuujjjjjjjkjmmmm. Ibibhvucufucuvivihohi
 
Lect14 lines+circles
Lect14 lines+circlesLect14 lines+circles
Lect14 lines+circles
 
Bresenhems line Genration derivation for Mtech
Bresenhems line Genration derivation for MtechBresenhems line Genration derivation for Mtech
Bresenhems line Genration derivation for Mtech
 
Unit-2 raster scan graphics,line,circle and polygon algorithms
Unit-2 raster scan graphics,line,circle and polygon algorithmsUnit-2 raster scan graphics,line,circle and polygon algorithms
Unit-2 raster scan graphics,line,circle and polygon algorithms
 

Recently uploaded

Conjugation, transduction and transformation
Conjugation, transduction and transformationConjugation, transduction and transformation
Conjugation, transduction and transformation
Areesha Ahmad
 
Seismic Method Estimate velocity from seismic data.pptx
Seismic Method Estimate velocity from seismic  data.pptxSeismic Method Estimate velocity from seismic  data.pptx
Seismic Method Estimate velocity from seismic data.pptx
AlMamun560346
 
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Lokesh Kothari
 
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
Lokesh Kothari
 

Recently uploaded (20)

Justdial Call Girls In Indirapuram, Ghaziabad, 8800357707 Escorts Service
Justdial Call Girls In Indirapuram, Ghaziabad, 8800357707 Escorts ServiceJustdial Call Girls In Indirapuram, Ghaziabad, 8800357707 Escorts Service
Justdial Call Girls In Indirapuram, Ghaziabad, 8800357707 Escorts Service
 
High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...
High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...
High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...
 
Botany 4th semester series (krishna).pdf
Botany 4th semester series (krishna).pdfBotany 4th semester series (krishna).pdf
Botany 4th semester series (krishna).pdf
 
GBSN - Microbiology (Unit 3)
GBSN - Microbiology (Unit 3)GBSN - Microbiology (Unit 3)
GBSN - Microbiology (Unit 3)
 
Conjugation, transduction and transformation
Conjugation, transduction and transformationConjugation, transduction and transformation
Conjugation, transduction and transformation
 
Forensic Biology & Its biological significance.pdf
Forensic Biology & Its biological significance.pdfForensic Biology & Its biological significance.pdf
Forensic Biology & Its biological significance.pdf
 
FAIRSpectra - Enabling the FAIRification of Spectroscopy and Spectrometry
FAIRSpectra - Enabling the FAIRification of Spectroscopy and SpectrometryFAIRSpectra - Enabling the FAIRification of Spectroscopy and Spectrometry
FAIRSpectra - Enabling the FAIRification of Spectroscopy and Spectrometry
 
Seismic Method Estimate velocity from seismic data.pptx
Seismic Method Estimate velocity from seismic  data.pptxSeismic Method Estimate velocity from seismic  data.pptx
Seismic Method Estimate velocity from seismic data.pptx
 
SAMASTIPUR CALL GIRL 7857803690 LOW PRICE ESCORT SERVICE
SAMASTIPUR CALL GIRL 7857803690  LOW PRICE  ESCORT SERVICESAMASTIPUR CALL GIRL 7857803690  LOW PRICE  ESCORT SERVICE
SAMASTIPUR CALL GIRL 7857803690 LOW PRICE ESCORT SERVICE
 
Hire 💕 9907093804 Hooghly Call Girls Service Call Girls Agency
Hire 💕 9907093804 Hooghly Call Girls Service Call Girls AgencyHire 💕 9907093804 Hooghly Call Girls Service Call Girls Agency
Hire 💕 9907093804 Hooghly Call Girls Service Call Girls Agency
 
Connaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verified
Connaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verifiedConnaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verified
Connaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verified
 
9999266834 Call Girls In Noida Sector 22 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 22 (Delhi) Call Girl Service9999266834 Call Girls In Noida Sector 22 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 22 (Delhi) Call Girl Service
 
American Type Culture Collection (ATCC).pptx
American Type Culture Collection (ATCC).pptxAmerican Type Culture Collection (ATCC).pptx
American Type Culture Collection (ATCC).pptx
 
Zoology 4th semester series (krishna).pdf
Zoology 4th semester series (krishna).pdfZoology 4th semester series (krishna).pdf
Zoology 4th semester series (krishna).pdf
 
GBSN - Microbiology (Unit 2)
GBSN - Microbiology (Unit 2)GBSN - Microbiology (Unit 2)
GBSN - Microbiology (Unit 2)
 
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
 
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
 
GBSN - Biochemistry (Unit 1)
GBSN - Biochemistry (Unit 1)GBSN - Biochemistry (Unit 1)
GBSN - Biochemistry (Unit 1)
 
Pulmonary drug delivery system M.pharm -2nd sem P'ceutics
Pulmonary drug delivery system M.pharm -2nd sem P'ceuticsPulmonary drug delivery system M.pharm -2nd sem P'ceutics
Pulmonary drug delivery system M.pharm -2nd sem P'ceutics
 
Call Girls Alandi Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Alandi Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Call Me 7737669865 Budget Friendly No Advance Booking
 

Raster Scan Graphics, Line Drawing Algorithm and Circle Drawing Algorithm

  • 1. Raster Scan Graphics Presented by Asst. Prof. Aparna Joshi
  • 2. Rasterization • The process of determining which pixel will provide the best approximation to the desired line is known as ‘Rasterization’.
  • 3. Characteristics of Line Drawing Algorithm • The line should appear straight. • Displayed line should have constant brightness along their length. • The line should be start and end accurately. • Lines should have constant density,. • Line density should be independent of line length and angle. • Lines should be drawn rapidly.
  • 4. DDA Line Drawing Algorithm 1. Read the line end points (x1, y1) & (x2, y2) such that they are not equal. (If equal then plot that single point and exit) . 2. Approximate the line length, If absolute (x2-x1) >= absolute (y2-y1) then length = absolute (x2-x1) else length = absolute (y2-y1) 3.
  • 5. DDA Line Drawing Algorithm 4. Using the sign function, make the algorithm work in all quadrant x = x1+0.5 * sign ( ∆x) y = y1 + 0.5 * sign (y) Here, x1 & y1 are initial values. 5. Begin main loop i = 1 while (i < = length) { plot (integer (x), Integer (y)) x= x+x y = y+y i = i + 1 } end while 6. Finish / Stop
  • 6. DDA Line Drawing Algorithm Advantages: • It is the simplest algorithm & it does not require special skills for implementation. • It is a faster method for calculating pixel positions than the direct use of equation y = m.x + b • It eliminates the multiplication in the equation by making use of raster characteristics, so that appropriate increments are applied in the x or y direction to find the pixel positions along the line path. • It is very easy to understand and implement. Disadvantages: • Floating point arithmetic in DDA algorithm is still time-consuming. • The algorithm is orientation dependent. Hence end point accuracy is poor. • It drifts away from the actual line path because of rounding off float values into integer.