Colored Anti-Aliasing

Today I hacked up the Escher peers some more, this time I implemented the actual pixelization routine for the antialiasing rasterizer. Before I only converted the coverage information to a grayscale between black and white, which of course looked stupid on colored background. Now it is doing the correct compositing of the foreground and background pixels. This is not exactly nice to implement on X, because (plain) X itself doesn’t support transparent colors or such thing. This means that for every non-fully-opaque or non-fully-translucent pixel I have to fetch the current surface pixel and do the math myself. The outcome can be seen below. Interesting to note is that the linear RGB scale doesn’t seem to do the job perfectly when interpolating linearily. The cyan foreground on red background seem so produce a slightly too dark transition. But for 99.99% of the usual use cases this approach is more than good enough.

Colored Anti-Aliasing

Another feature I added to the Escher peers is configurable font mappings through a properties file. This could be improved by adding support for fontconfig stuff. I have to think how to best implement it. IIRC, fontconfig works via a bunch of XML configuration files. Maybe I’ll add a small Java-only fontconfig parser and library and get my font info from there (as an alternative to the approach).


About Roman Kennke
JVM Hacker, Principal Software Engineer at Red Hat's OpenJDK team, Shenandoah GC project lead, Java Champion

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: