- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to apply antialiasing in HTML5 canvas drawImage()?
59 Lectures 8.5 hours
68 Lectures 8 hours
For antialiasing, you need to set resampling quality.
ctx.imageSmoothingQuality = "low|medium|high"
Use an off-screen canvas to reduce the image to half −
var c = document.createElement('canvas'), ocx = c.getContext('2d'); c.width = img.width * 0.5; c.height = img.height * 0.5; ocxx.drawImage(img, 0, 0, c.width, c.height);
// drawing images reducing to half again and repeating it
ocx.drawImage(c, 0, 0, c.width * 0.5, cc.height * 0.5);
- HTML5 drawImage() method to draw image onto the canvas
- How to draw an Image with drawImage() in HTML5?
- Apply gravity between two or more objects in HTML5 Canvas
- How to center canvas in HTML5?
- Translating HTML5 canvas
- HTML5 Canvas distorted
- HTML5 Canvas Transformation
- How to detect point on canvas after canvas rotation in HTML5
- How to draw lines using HTML5 Canvas?
- How to use images with HTML5 canvas?
- HTML5 Canvas to PNG File
- HTML5 Canvas fit to window
- How to draw an oval in HTML5 canvas?
- How to save HTML5 canvas data to file?
- How to save canvas data to file in HTML5?