4 ms·
That doesn't work either, since browsers don't respect exact pixel sizes for elements even at 100% and at other zoom settings all bets are off. That is why I c
by AndrewStephens 4y ago
That doesn't work either, since browsers don't respect exact pixel sizes for elements even at 100% and at other zoom settings all bets are off.
That is why I created this project[0], recently discussed here[1]
[0] https://sheep.horse/2022/12/pixel_accurate_atkinson_dithering_for_images_in_ht.html https://sheep.horse/2022/12/pixel_accurate_atkinson_ditherin...
[1] https://news.ycombinator.com/item?id=34052253 https://news.ycombinator.com/item?id=34052253
- aliqot 4y agoDoing the lord's work, thank you.
- AndrewStephens 4y agoVersion two is on the way...
- layer8 4y ago> even at 100% Can you give more background or references for this? It hasn’t been my experience, at least on desktop.
- AndrewStephens 4y agoThe 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.
- rcthompson 4y agoOn top of what everyone else has said, someone might simply be using a non-native resolution on their monitor. (Does MacOS still default to non-integer scaling on MacBooks?)