On Monday 23 September 2002 11:05 pm, Keith Packard wrote:
| Around 15 o'clock on Sep 21, Allen Akin wrote:
| > Also, do you have a standard display calibration procedure (or hardware)
| > you use before comparing screenshots?
|
| Yes, this is crucial -- attempting to compare AA images on uncalibrated
| monitors is hopeless. The AA line work by Sun of a few years ago had some
| calibration screens that we might use to adjust monitor gamma using the
| 'xgamma' program.
|
| > I haven't looked at the Xft code, but my understanding was that it uses
| > simple geometric coverage (a one-pixel-square box filter) with enough
| > precision to yield 256 levels in the final result.
|
| Yes, this is how FreeType works. Xft doesn't do any of this work, it gets
| bits from FreeType. The geometric coverage is computed analytically which
| avoids dropouts from very thin elements and a few other features.
well, let me quote mail from David Turner (hope David doesn't mind it), from
our off-list discussionof anti-aliasing & oversampling:
- - - - - - - - - - - - - - - - - - - -
... there are other efficient algorithms to perform high-quality
anti-aliasing. For example, FreeType uses an analytical algorithm to
directly compute pixel coverage which is roughly equivalent to
oversampling the pixels by a scale of *64x64*, then filtering it
with a simple box filter (also called "bit-counting filter" when
applied to monochrome bitmaps)
[snipped...]
Generally, one can greatly enhance the quality of anti-aliased text by
using a different filter (for example, a conic filter on a 4x4 kernel),
but this usually takes a _lot_ of CPU resources. Note that there is an
interesting article from a Microsoft researcher on ways to speed this
process through clever approximations. Please see:
http://citeseer.nj.nec.com/90193.html
It has also a good description of various anti-aliasing methods commonly
used in 3D rendering, but that can also be applied for "simple" 2D as well.
The method described there is compatible with anti-aliased glyph rendering,
though it is still somewhat CPU heavy for my own tastes. Not that I'll never
try to implement it some day though ;-)
Generally speaking, a 4x4 box filter isn't really great in terms of quality,
and it's also not very fast if you perform bit-counting (even when using
clever tricks, trust me, I've been there too :-)
Hope this helps,
- David Turner
- The FreeType Project (www.freetype.org)
- - - - - - - - - - - - - - - - - - - -
so, while FreeType indeed computes pixel coverage, algorithm is not that
simple.
|
| While this box filter is "wrong" from a signal processing perspective,
| it's essentially correct for LCD screens and pretty reasonable whe using a
| CRT as we take advantage of the frequencies available at pixel edges.
|
| Where Xft does a bit of work is in adapting this box filter to LCD
| screens. For that, the steps are:
|
| Scale geometry to pixel size
| Execute hints to adjust geometry
| Triple geometry width (height for rotated screens)
| Box filter (rasterize) to generate separate RGB coverage
| Intra-pixel filter to reduce color fringing
Keith, what do you think about latest David Turner's comments on LCD rendering
(that "it should be better turned Off, at least while Xft is not fixed"):
http://freetype.sourceforge.net/freetype2/smooth-hinting.html
It seems David still haven't uploaded pictures (screesnhots), but I think
everyone interested can get screesnhots himself, using latest FreeType
2.1.3-rc2 or FreeType CVS.
|
| Note that Render doesnt (yet) provide any gamma correction when doing
| image compositing, so the final result on the screen is far from ideal.
|
| Keith Packard XFree86 Core Team HP Cambridge Research Lab
|
| _______________________________________________
| Render mailing list
| [EMAIL PROTECTED]
| http://XFree86.Org/mailman/listinfo/render
--
Vadim Plessky
http://kde2.newmail.ru (English)
33 Window Decorations and 6 Widget Styles for KDE
http://kde2.newmail.ru/kde_themes.html
KDE mini-Themes
http://kde2.newmail.ru/themes/
_______________________________________________
Render mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/render