Can I turn off antialiasing on an HTML <canvas> element?
I'm playing around with the <canvas> element, drawing lines and such. I've noticed that my diagonal lines are antialiased. I'd prefer the jaggy look for what I'm doing - is there any way of turning this feature off? For images there's now context.imageSmoothingEnabled = false . However, there's nothing that explicitly controls line drawing. You may need to draw your own lines ( the hard way ) using getImageData and putImageData . Draw your 1-pixel lines on coordinates like ctx.lineTo(10.5, 10.5) . Drawing a one-pixel line over the point (10, 10) means, that this 1 pixel at that position