I'm trying to add my pixelart to the canvas, but there I met the problem. That image is blurry so I added in canvas css style image-rendering: pixelated. But it's same as before. When I add same style to image outside canvas it's well pixelated. Can someone give me a tip? Why it doesn't work in canvas? Thank you for all replies!
Javascript:
ctx.drawImage(this.img, this.x - this.size/2, this.y - this.size/2, this.size, this.size)
CSS:
#canvas {
position: relative;
image-rendering: pixelated;
width: 256px;
height: 256px;
}