Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
How to apply antialiasing in HTML5 canvas drawImage()?
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);
Advertisements
