Earlier quoted context omitted.
I'm saying it because I've actually read the spec. The spec https://drafts.csswg.org/css-images/#the-image-rendering says > pixelated: > The image is scaled in a way that preserves the pixelated nature of the original as much as possible, but allows minor smoothing instead of awkward distortion when necessary. The spec does not say "use nearest neighbor". In fact in specifically allows not using nearest neighbor (end…
It explicitly says in the crisp-edges section: > The image must be scaled with the "nearest neighbor" algorithm: treating the original image’s pixel grid as a literal grid of rectangles, scale those to the desired size, then each pixel of the final image takes its color solely from the nearest pixel of the scaled original image. and then it explicitly says in the pixelated section, right after the summarizing sentenc…
https://github.com/w3c/csswg-drafts/issues/6038
That said, my main point stands, Nearest Neighbor looks horrible when you have a non-integer devicePixelRatio which is relatively common. You'll get better results upscaling the image offline and then downscaling in the browser, rather than upscaling in the browser.