4 ms·
The pixel (as CSS defines it) does not correspond to an individual pixel on-screen. The is (literally) doubly true for high-DPI screen where a single CSS pixel
by AndrewStephens 4y ago
The pixel (as CSS defines it) does not correspond to an individual pixel on-screen. The is (literally) doubly true for high-DPI screen where a single CSS pixel might contain 4 or even 9 real pixels on the display.
The browser is very good at scaling images up so that they look good but at some point it will have to interpolate from image pixels to screen pixels. This is fine for almost all images but plays havoc with images that have already gone through a dithering process.
For color images it doesn't matter so much but for my project I wanted the really harsh all-black-and-white pixels of old.
- layer8 4y agoI’m aware of what you’re describing, but at 100% zoom (and 100% DPI) my experience is that you do get a 1:1 pixel mapping (which I very much care about, and so far haven’t had trouble achieving, as a user). The above quote gave the impression that this isn’t always true, and I was asking about that.
- AndrewStephens 4y agoIt might work for you as a user if you set your monitor up right but you absolutely cannot put up a web page and expect the 1:1 pixel mapping to be preserved for everyone who visits your site. Between my phone, tablet, and two laptops, I don't even have a standard DPI display device anymore, and I hardly run bleeding-edge hardware. Everything is going to be scaled.