pixel art getting blured for no real reason
I have pixel art, and i want to use it in one of my projects, due to wanting to reduce file size and how I make it the pixel art is a 5x5 image and drawing the image isn't working at all. is the image the issue or is something in the way I'm drawing it the issue also here's the orginal image.
I found a solution after a bit more searching
ctx.imageSmoothingEnabled = false;
that makes all the issues disappear!
Voters
Your image has to be larger.
When an image is upscaled, it loses its quality. I won't bore you with exactly why, but it's something about pixels.
Anyways, what you should have done instead was create the image at a large size so when you downscale it, the quality is good.
@Coder100 I never downsized it, this is its original size. I'm using the images from the project and there all the images work just fine, this is also where I created the art. I want to try and keep file sizes down too, any idea how to get the images to work better without a larger file size?(for loading times)
@Coder100 yeah just has to double the image size, it's gone now idk why it had issues.
@Coder100 I found a better way! :D after searching for a while I found
ctx.imageSmoothingEnabled = false;
and that makes all the issues just go away! :D I hope this helps you as much as it helps me :Dah yes, and don't forget to also do that for the canvas itself too
something about pixelRatio @Mathman05