logoalt Hacker News

panzi12/09/20242 repliesview on HN

On a page like this you should really use the CSS style:

    img {
        image-rendering: pixelated;
    }

Replies

nox10112/10/2024

It's not that simple because the user's devicePixelRatio might be fractional. Say it's 1.5, then scaling up, some low-res pixels get scaled up to N pixels and other to N+1 and you can get something really ugly, especially if the thing you're scaling is a stippled pattern.

show 1 reply
panzi12/09/2024

(Because otherwise it's all blurry on a high DPI monitor.)