I had a similar graphics glitch problem when I would do html5 image resizing with my games (or use CTRL+ / CTRL- to change to the size of everything on the window). I think it has to do with the source rounding down to the pixel values above where the sprite is kept. That was one of my incentives for learning how to output pixel perfect tiles and sprites.
Viewing post in A wishing race jam comments
I do my web browser games from scratch using raw javascript, so I don't know if this will be any help. What I learned was I had to control two elements of the canvas.
The first part was with css. This is placed in my index page:
- canvas,body{image-rendering:-moz-crisp-edges;image-rendering:-webkit-crisp-edges;image-rendering:pixelated;}
And then with javascript, you have to make sure this is kept because anytime a canvas element is changed (new size, sometimes clearing it, etc., it will auto default to the blurry style again.
- const D=(a)=>{return document.getElementById(a)} }let k=D(x),i="mageSmoothingEnabled";k.width=a,k.height=b;let ctx=D(x).getContext("2d");window['ctx.i'+i]=false;window['ctx.mozI'+i]=false;window['ctx.msI'+i]=false;window['ctx.webkitI'+i]=false
Maybe you can find some equivalent in Godot or this can help point you in the right direction? I cannot say. I have never looked into Godot.