Để anti-aliasing, bạn cần đặt chất lượng resampling.
ctx.imageSmoothingQuality = "low|medium|high"
Dùng canvas off-screen để giảm hình ảnh một nửa −
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);
// vẽ hình ảnh giảm nửa lại và lặp lại
ocx.drawImage(c, 0, 0, c.width * 0.5, cc.height * 0.5);