4 ms·
A UI element will almost never be perfectly square, exactly aligned on a pixel. And even if it was, LCD pixels aren't even squares. They are three rectangles wi
by sudosysgen 6y ago
A UI element will almost never be perfectly square, exactly aligned on a pixel. And even if it was, LCD pixels aren't even squares. They are three rectangles with different colors and gaps between them. This fact means that if you want to have proper representation of even a pixel-perfect square, because of the gap between pixels and because of sub-pixels, a perfect representation would not be such.
- megameter 6y agoMost pixel art today is designed around square pixels. The pixels are typically blown up to some multiple for viewing - and in many cases, not even an integer multiple! This has resulted in the design of filter kernels that make some trade-off between the true sharpness of square pixels and the aliasing of nearest neighbor interpolation. Therefore, even before images hit the display there is a rationale to avoid using photographic resampling techniques, just because the method of their authoring defined the meaning otherwise. See also: The gradual evolution of font rendering techniques. Earlier versions of Windows aimed for pixel-grid snapping to produce clean, sharp edges. Newer ones introduced anti-aliasing techniques, but again made trade-offs towards sharp edges, including exploitation of the LCD display format, while the contemporary Apple rendering favored the photographic approach. With the introduction of high DPI the differences have become less pronounced, but there's still disagreement about how best to render vector fonts into pixels.
- jack1243star 6y agoThe UI elements I use most, such as the mouse cursor and window borders are perfectly aligned to the pixel grid.
- sudosysgen 6y agoI don't know about yours, but my mouse cursor is not a perfectly straight 2+ pixel wide solid-colored rectangle, so that doesn't really matter. As for windows edges, I'll give you that one. However, the edge of my window happens not to be green, so it doesn't actually align with the elements of my LCD :) I just so happen not to notice it, because my eyes don't have individual pixel resolution, almost as if there was a low-pass filter of the order > 2 lambda... Food for thought!
- Dylan16807 6y agoAlso if your screen isn't particularly high resolution, fonts tend to align to the pixel grid for extra sharpness.
- jack1243star 6y agoWhat you describe is font hinting [0], a nice example would be the Luculent font[1]. [0] https://en.wikipedia.org/wiki/Font_hinting https://en.wikipedia.org/wiki/Font_hinting [1] http://eastfarthing.com/luculent/ http://eastfarthing.com/luculent/
- geofft 6y agoThen how come a column of white pixels next to a column of black pixels looks perfectly sharp, as sharp as a black sheet of paper on a white background? Whatever pixels "are", they are certainly tools for inducing a certain perception in the eye of the viewer, so we should go by how that works. We're used to this from color itself - no one denies that 0xffff00 is "yellow", despite the physical emission containing no yellow light, because red + green in certain proportions induces the same response in our eyes as light whose wavelength is actually yellow. So why can't we apply the term "squares" to things that our eyes see as squares even if they are not physically squares?
- sudosysgen 6y agoSimple, it absolutely does not at all. Here: https://i.stack.imgur.com/n6snK.png https://i.stack.imgur.com/n6snK.png. Open this in IrfanView, set the magnification to 100%. It looks about 75%-25% dark grey to light grey unless you really focus on it. This is exactly what you would expect if you conceptualize pixels as points. So no, a column of white pixels next to a column of black pixels does not look perfectly sharp. If it did, the image above would look perfectly black and white, with no grey. And by the time I approach the pixels enough to see perfect black vs perfect white, I also notice the black gaps between pixels, and very soon the sub-pixels themselves! This is also why you don't see individual sub-pixels, by the way. Your eyes largely cannot distinguish the individual squares that pixels are if you are using a non-ancient screen. Your eye does not form an image of the square pixel. It largely loses them as they blend into each other to form an image, in which pixels are much, much closer to points than they are to squares.
- Dylan16807 6y agoNot 'perfectly' sharp, but if you have a bunch of objects where the edges go from 0 to 200, and you have a bunch of objects where the edges go from 0 to 100 to 200, there is a significant difference in sharpness on most screens.
- sudosysgen 6y agoSure. And that is also perfectly consistent with considering pixels are dimensionless points forming an image, which they really are in practice much more than they are simply squares. Indeed, an edge that goes from 0 to 100 can be considered as part of a wave of twice the frequency but the same amplitude as compared to an edge that goes from 0 to 200. Which is, by the way, why increasing the contrast in an image, especially micro-contrast, in practice increases resolution.