SlideShare a Scribd company logo
9
Most read
12
Most read
16
Most read
CS 455 – Computer Graphics Antialiasing
Aliasing Aliasing:  a high-frequency signal masquerading as a low frequency Caused by insufficient sampling  (sampling interval too large) Sampling Interval Actual (high-frequency) signal Sampled (aliased) signal
Strobe light on dripping water:  Temporal aliasing Spokes on a rotating wheel:  Temporal aliasing Moir é  patterns:  Spatial aliasing Examples of Aliasing
Aliasing and Line Drawing We draw lines by sampling at intervals of one pixel and drawing the closest pixels Sampling Interval Sampling Interval Results in stair-stepping  (i.e., the dreaded “jaggies”)
Antialiasing Lines Idea: Make line “fatter” Fade line out (removes high frequencies) Now sample the line
Antialiasing Lines Solution 1 – Unweighted Area Sampling: Treat line as a single-pixel wide rectangle Color pixels according to the percentage of each pixel that is “covered” by the rectangle
Solution 1: Unweighted Area Sampling Pixel area is unit square Constant weighting function  Pixel color is determined by computing the amount of the pixel covered by the line, then shading accordingly Easy to compute, gives reasonable results Line One Pixel
Solution 2: Weighted Area Sampling Treat pixel area as a circle with a radius of one pixel Use a radially symmetric weighting function  (e.g., cone) : Areas closer to the pixel center are weighted more heavily Better results than unweighted, slightly higher cost Line One Pixel
Solution 3:  Gupta-Sproull algorithm Calculate pixel intensity by computing distance from pixel center to line using the midpoint line algorithm x p NE m E  x p+1 Line to draw v y p y p+1    D
Gupta-Sproull algorithm (cont) D is the perpendicular distance from E to the line How do we compute it? a How does triangle abc compare to triangle ade? D  c = e, and a = a, so b must equal d b c d e dx dy v r r
Gupta-Sproull algorithm (cont) D is the perpendicular distance from E to the line How do we compute it? a So: D  b c d e dx dy v r r And: Then:
Gupta-Sproull algorithm  (cont) Recall from the midpoint algorithm: So For pixel E: So: x p NE m E  x p+1 Line to draw v y p y p +1    D
Gupta-Sproull algorithm (cont) From previous slide: So From the midpoint computation, So: x p NE m E  x p+1 Line to draw v y p y p+1    D
Gupta-Sproull algorithm (cont) From the midpoint algorithm, we had the decision variable (remember?) Going back to our previous equation: x p NE m E  x p+1 Line to draw v y p y p +1    D
Gupta-Sproull algorithm (cont) So, And the denominator is constant Since we are blurring the line, we also need to compute the distances to points y p  – 1 and y p  + 1
Gupta-Sproull algorithm (cont) If the NE pixel had been chosen:
Gupta-Sproull algorithm (cont) Compute midpoint line algorithm, with the following alterations: At each iteration of the algorithm: If the E pixel is chosen, set numerator = d + dx If the NE pixel is chosen, set numerator = d – dx Update d as in the regular algorithm Compute D = numerator/denominator Color the current pixel according to D Compute D upper  = (2dx-2vdx)/denominator Compute D lower  = (2dx+2vdx)/denominator Color upper and lower accordingly
Solution 4: Super-sampling Divide pixel up into “sub-pixels”:  2  2, 3  3, 4  4, etc. Sub-pixel is colored if inside line Pixel color is the average of its sub-pixel colors Easy to implement  (in software and hardware) No antialiasing Antialiasing  (2  2 super-sampling)
Solution 5: Sum of Foreground and Background Compute percent of pixel covered by line,  p Line color is  c l Background color is  c b Pixel color is the sum of this percent multiplied by the line color, plus the percent of the pixel not covered by the line multiplied by the background color, i.e., color = p * c l  + (1-p) * c b
Polygon Antialiasing To antialias a line, we treat it as a polygon  (a rectangle) Antialiasing a polygon  (or any shape primitive)  is similar Some concerns: Corners:  Complicate the coverage computation Micro-polygons:  smaller than a pixel Super-sampling:  There may still be polygons that “slip between the cracks”

More Related Content

PDF
Digital Image Fundamentals
PPTX
Psuedo color
DOC
Digital image processing questions
PPTX
Image Sensing and Acquisition.pptx
PPTX
Lossless predictive coding in Digital Image Processing
PPTX
Hidden surface removal
PPT
Image segmentation
PPTX
Edge detection
Digital Image Fundamentals
Psuedo color
Digital image processing questions
Image Sensing and Acquisition.pptx
Lossless predictive coding in Digital Image Processing
Hidden surface removal
Image segmentation
Edge detection

What's hot (20)

PPTX
Application of edge detection
PPT
2D transformation (Computer Graphics)
PPTX
Loop optimization
PPTX
Region based segmentation
PPTX
Predictive coding
PPTX
Image Enhancement in Spatial Domain
PPT
Frequency Domain Image Enhancement Techniques
PDF
Ai notes
PPTX
Chapter 1 and 2 gonzalez and woods
PPSX
Image Enhancement in Spatial Domain
PPTX
Image Sampling and Quantization.pptx
PPTX
Raster animation
PPTX
Image Filtering in the Frequency Domain
PPT
Chapter10 image segmentation
PPTX
Chapter 3 image enhancement (spatial domain)
PPSX
Edge Detection and Segmentation
PPTX
1.arithmetic & logical operations
PPTX
3 d display-methods
PPTX
5. gray level transformation
PPT
Enhancement in spatial domain
Application of edge detection
2D transformation (Computer Graphics)
Loop optimization
Region based segmentation
Predictive coding
Image Enhancement in Spatial Domain
Frequency Domain Image Enhancement Techniques
Ai notes
Chapter 1 and 2 gonzalez and woods
Image Enhancement in Spatial Domain
Image Sampling and Quantization.pptx
Raster animation
Image Filtering in the Frequency Domain
Chapter10 image segmentation
Chapter 3 image enhancement (spatial domain)
Edge Detection and Segmentation
1.arithmetic & logical operations
3 d display-methods
5. gray level transformation
Enhancement in spatial domain
Ad

Similar to Lecture15 anti aliasing (20)

PPT
Lect14 lines+circles
PDF
Unit 2
PDF
Unit-2 raster scan graphics,line,circle and polygon algorithms
PDF
Computer Graphics Notes 2.pdf
PPTX
CG _LINE DRAWING_algorithm_Algorithm_frame_buffer.pptx
PPTX
Study on Fundamentals of Raster Scan Graphics
PPT
03raster 1
PPT
1536 graphics & graphical programming
PDF
Computer graphics notes
PDF
2. IP Fundamentals.pdf
PDF
Computer graphics notes watermark
PPTX
4 CG_U1_M3_PPT_4 DDA.pptx
PDF
raster algorithm.pdf
PPT
Bresenham circlesandpolygons
PPT
Bresenham circles and polygons derication
PPTX
Waveform_codingUNIT-II_DC_-PPT.pptx
PPT
99995320.ppt
PPTX
Lec02 03 rasterization
Lect14 lines+circles
Unit 2
Unit-2 raster scan graphics,line,circle and polygon algorithms
Computer Graphics Notes 2.pdf
CG _LINE DRAWING_algorithm_Algorithm_frame_buffer.pptx
Study on Fundamentals of Raster Scan Graphics
03raster 1
1536 graphics & graphical programming
Computer graphics notes
2. IP Fundamentals.pdf
Computer graphics notes watermark
4 CG_U1_M3_PPT_4 DDA.pptx
raster algorithm.pdf
Bresenham circlesandpolygons
Bresenham circles and polygons derication
Waveform_codingUNIT-II_DC_-PPT.pptx
99995320.ppt
Lec02 03 rasterization
Ad

Recently uploaded (20)

PPTX
Big Data Technologies - Introduction.pptx
PDF
Empathic Computing: Creating Shared Understanding
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
KodekX | Application Modernization Development
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Cloud computing and distributed systems.
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Encapsulation theory and applications.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Approach and Philosophy of On baking technology
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Big Data Technologies - Introduction.pptx
Empathic Computing: Creating Shared Understanding
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Review of recent advances in non-invasive hemoglobin estimation
Digital-Transformation-Roadmap-for-Companies.pptx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Programs and apps: productivity, graphics, security and other tools
KodekX | Application Modernization Development
Machine learning based COVID-19 study performance prediction
Cloud computing and distributed systems.
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
The AUB Centre for AI in Media Proposal.docx
Understanding_Digital_Forensics_Presentation.pptx
Encapsulation theory and applications.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Approach and Philosophy of On baking technology
Chapter 3 Spatial Domain Image Processing.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows

Lecture15 anti aliasing

  • 1. CS 455 – Computer Graphics Antialiasing
  • 2. Aliasing Aliasing: a high-frequency signal masquerading as a low frequency Caused by insufficient sampling (sampling interval too large) Sampling Interval Actual (high-frequency) signal Sampled (aliased) signal
  • 3. Strobe light on dripping water: Temporal aliasing Spokes on a rotating wheel: Temporal aliasing Moir é patterns: Spatial aliasing Examples of Aliasing
  • 4. Aliasing and Line Drawing We draw lines by sampling at intervals of one pixel and drawing the closest pixels Sampling Interval Sampling Interval Results in stair-stepping (i.e., the dreaded “jaggies”)
  • 5. Antialiasing Lines Idea: Make line “fatter” Fade line out (removes high frequencies) Now sample the line
  • 6. Antialiasing Lines Solution 1 – Unweighted Area Sampling: Treat line as a single-pixel wide rectangle Color pixels according to the percentage of each pixel that is “covered” by the rectangle
  • 7. Solution 1: Unweighted Area Sampling Pixel area is unit square Constant weighting function Pixel color is determined by computing the amount of the pixel covered by the line, then shading accordingly Easy to compute, gives reasonable results Line One Pixel
  • 8. Solution 2: Weighted Area Sampling Treat pixel area as a circle with a radius of one pixel Use a radially symmetric weighting function (e.g., cone) : Areas closer to the pixel center are weighted more heavily Better results than unweighted, slightly higher cost Line One Pixel
  • 9. Solution 3: Gupta-Sproull algorithm Calculate pixel intensity by computing distance from pixel center to line using the midpoint line algorithm x p NE m E x p+1 Line to draw v y p y p+1  D
  • 10. Gupta-Sproull algorithm (cont) D is the perpendicular distance from E to the line How do we compute it? a How does triangle abc compare to triangle ade? D c = e, and a = a, so b must equal d b c d e dx dy v r r
  • 11. Gupta-Sproull algorithm (cont) D is the perpendicular distance from E to the line How do we compute it? a So: D b c d e dx dy v r r And: Then:
  • 12. Gupta-Sproull algorithm (cont) Recall from the midpoint algorithm: So For pixel E: So: x p NE m E x p+1 Line to draw v y p y p +1  D
  • 13. Gupta-Sproull algorithm (cont) From previous slide: So From the midpoint computation, So: x p NE m E x p+1 Line to draw v y p y p+1  D
  • 14. Gupta-Sproull algorithm (cont) From the midpoint algorithm, we had the decision variable (remember?) Going back to our previous equation: x p NE m E x p+1 Line to draw v y p y p +1  D
  • 15. Gupta-Sproull algorithm (cont) So, And the denominator is constant Since we are blurring the line, we also need to compute the distances to points y p – 1 and y p + 1
  • 16. Gupta-Sproull algorithm (cont) If the NE pixel had been chosen:
  • 17. Gupta-Sproull algorithm (cont) Compute midpoint line algorithm, with the following alterations: At each iteration of the algorithm: If the E pixel is chosen, set numerator = d + dx If the NE pixel is chosen, set numerator = d – dx Update d as in the regular algorithm Compute D = numerator/denominator Color the current pixel according to D Compute D upper = (2dx-2vdx)/denominator Compute D lower = (2dx+2vdx)/denominator Color upper and lower accordingly
  • 18. Solution 4: Super-sampling Divide pixel up into “sub-pixels”: 2  2, 3  3, 4  4, etc. Sub-pixel is colored if inside line Pixel color is the average of its sub-pixel colors Easy to implement (in software and hardware) No antialiasing Antialiasing (2  2 super-sampling)
  • 19. Solution 5: Sum of Foreground and Background Compute percent of pixel covered by line, p Line color is c l Background color is c b Pixel color is the sum of this percent multiplied by the line color, plus the percent of the pixel not covered by the line multiplied by the background color, i.e., color = p * c l + (1-p) * c b
  • 20. Polygon Antialiasing To antialias a line, we treat it as a polygon (a rectangle) Antialiasing a polygon (or any shape primitive) is similar Some concerns: Corners: Complicate the coverage computation Micro-polygons: smaller than a pixel Super-sampling: There may still be polygons that “slip between the cracks”