lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


The screenshots are not very helpful for me, given that the "subpixel" rendering uses a larger font size in these screenshots.
To make a true difference the font metrics should be preserved.
In fact I suppose that on Windows this is not even needed: the text rendering is already hinted by Windows's text renderer used by default with its existing display settings (so it is already using CleartType, with gamma correction and subpixel RGB/GBR display, using also a convolution matrix on the 2 nearest subpixels on each side to correct/avoid the color artefacts that could appear).

Note that subpixel rendering also has to take into account horizontal/vertical orientation of the screen (yes screens can be physically rotated, especially on mobile devices, but also on some desktop displays: Windows can capture the event where such rotation occurred and will adapt automatically the ClearType settings by using a different subpixel matrix, and font hinting will still occur appropriately; the convolution matrix is not a square but a rectangle, or 3 squares; and the grid of minimal resolution has one of the dimensions with triple resolution along the RGB/GBR axis which is not necessarily horizontal)

Windows also is aware that some displays do not use RGB display (with horizontally aligned subpixels with the same surface): there are other display technologies that use 4 subpixels: R/G/B plus white, or R/G/B plus yellow and these subpixels are not aligned horizontally and don't have the same proportion. So basically the pixel grid is still prevailing, font hinting must still occur in both directions, and the adjustment for color correction has to take into account subpixels and consider their actual geometry in the two axis simultaneously if you want to improve the rendering!

For these devices, the subpixel matrix (for the coordinate resolution) is not 3x1 but 2x2 (if the subpixels form a regular grid of squares) or more accurately 3x3 or 4x4 (if they are not all the same size), and the color correction (into nearby pixels) is using a different convolution matrix (9x9 or 12x12, instead of 9x1 with classic RGB/GBR geometry). In all cases, there's still a gamma factor for this correction, but most LCD displays use the same gamma factor in order to be compliant to the sRGB color model. With this kind of display, you cannot just compute the 3 color planes separately (like for RGB/GBR), you compute 4 "virtual" color planes, then you recompose the 3 RGB color planes to generate the sRGB display (you have to know how the display transforms sRGB into the 4-components; this transform requires that sRGB is encoded with 9-bit per R/G/B plane at least, to get at least 8-bit on each one of the 4-component physical model; these displays actually take an sRGB color model on input with more than 24-bits, e.g. they take 10 bits for R, 11 bits for G and B for a total of 32 bits for all color components, and from this they will compute 4 components with at least 9-bit for each; some devices are now using 48-bit sRGB input and will accurately render 4 components with at least 12 bits for each: they generate a very great color gamut, especially in the natural brown-green colors, but as well in the darkest areas of images, or with improved contrast in the very light areas where the "grain" texturing is preserved; shadows are subtle but much more evidently visible, so the 3D-depth effect is improved as well).

Such devices with improved colors (better than plain 24-bit sRGB) are still rare on the desktop, but now common on mobile Hi-DPI devices (like tablets and smartphones) and on large smartTV displays (see Samsung), it is even more economic than building an 8K display (a 4K display is enough, 8K displays are not worth the value if they still use the native sRGB horizontal subpixel geometry as their subpixel contrast is poor and the color gamut is too much restricted to see a convincing difference: the horizontal alignment of physical subpixels is not optimal and does not match the actual human vision); 4-component displays are definitely an excellent solution for the many people (most often male people, more of them Caucasian) that have color-vision "defects" but are still not dichromat or achromat (they are trichromat but with a modified green cone sensitivity slightly moved towards the red wavelengths), or for the rare people (most often female people and Caucasian) that can see more than 3 color planes and see more colors than the average population (e.g. they have the two different green cones centered at different wavelengths, or have an additional type of cones whose sensitivity is centered on orange or magenta wavelengths).



Le mar. 9 juin 2020 à 22:43, Francesco Abbate <francesco.bbt@gmail.com> a écrit :
> Very interesting! Do you happen to have before & after screenshots somewhere?

Thank you for asking. It is a good idea so here there are some
screenshots to compare with and without subpixel font rendering.

https://github.com/rxi/lite/issues/145#issuecomment-641554095

Actually I have introduced not only subpixel but also "slight hinting"
i.e. hinting only in the y axis and gamma correction.

> However, I doubt this gets accepted to the main repo because it brings so many new dependencies, but definitely worth a try! In any case a fork is always a good option.

Agree, the Lite's author is very inclined on minimalism so he may not
accept the complexity brought by the AGG library with C++ and the
additional dependencies (AGG library and Freetype2). IMHO the result
is worth the additional complexity but other people may have a
different advice.

Francesco