Why not using subpixel antialiasing?

Why isn’t subpixel antialiasing used for the OpenStreetMap maps? I’ve read about Mapnik that it would support that. Even the OSM Wiki page about Mapnik lists this at the very top as an outstanding feature.

Care to give an example where this can be seen?

I don’t know what you want to be seen. I’m trying to resolve any references from my first posting:

  • Subpixel anti-aliasing clearly is not used today for the slippy map. Use your favourite screen loupe tool to check it.
  • Mapnik “offers world class anti-aliasing rendering with subpixel accuracy”: http://mapnik.org/faq/
  • The OSM Wiki page about Mapnik: http://wiki.openstreetmap.org/wiki/Mapnik (3rd paragraph, 3rd sentence)

So everybody’s talking about it, but nobody’s using it. Why?

The antialias seems pretty fine to me, can you show us what you base your statements on. I did some search on mapnik subpixel accuracy but I got no usefull example images of before and after. Not even sure you can shut it off since that page sates “subpixel anti-aliasing capabilities are the standout reason for the beauty of Mapnik output.”

The currently used antialias is only with grey levels or entire pixels. It does not use subpixels. If it would do, you could very easily tell by the colour shift that becomes visible when you scale up a screenshot by maybe 5x or more (which is what a screen loupe does).

I haven’t found any examples of Mapnik’s oh-so-wonderful subpixel antialiasing yet. Also on the page you linked there’s no such example. I’m beginning to wonder if everybody known what subpixel antialiasing actually is? (I guess they should, since there’s a link to the according Wikipedia article on the same page.)

The currently used antialias may look fine (to you), but it probably could be significantly better (clearer and sharper, especially when it comes to small text) with subpixel antialiasing. Just turn on the ClearType method in your Windows XP/Vista display settings. (Vista already enables it from the start.) Linux also features such a method but its effect is almost not noticeable. Sure this only works on a common vRGB LCD display, it doesn’t work well on CRT displays.

I think, what you want to see is subpixel rendering, as described in http://en.wikipedia.org/wiki/Subpixel_rendering. I don’t think that this would be appropriate to do for a tool that doesn’t know the rgb layout of the screen the result is displayed on. You would have to set your rgb pixel layout in the software for it to make sense. Otherwise the results could be worse than without it.

So, is there a simple way to render my own Mapnik maps? I’ve looked into that recently but couldn’t find a ready-to-use piece of software to render OSM data into a pixel image. All I found was the blank Mapnik source code, but that certainly wouldn’t generate maps like on the OSM site. The common (256px)² tile scheme would be perfect because I have a programme for navigating through those tiles like on the official web page.

Aaah! now I understand, but as said above; LCDs have different layouts of the colors so you have to set this up per LCD. (I’m pretty sure most PC LCDs have the same color sequence though).

(Just to be clear, I originally did mean to use subpixel anti-aliasing (I see no difference to the less precise wording “subpixel rendering”) for the official Slippy Map. Since so many seem to have problems with it, I’d now like to render my own Mapnik map tiles. Be it only to evaluate its use. Thus the new question…)

There is nothing shrink wrapped that will produce images for you, but you can of course setup your own Linux server following the instructions on the mapnik openstreetmap installtion guide

I’d guess that sub-pixel anti-aliasing of text isn’t used (in neither OSM nor Mapnik) for some combination of these reasons:

a) you need to know the rgb order of the display panel, so generally it’s user setting
b) the effect relies on user taste to some degree. Even Apple, who don’t give options lightly have different settings.
c) lots of map text isn’t straight left-to-right, often being at angles or even curving round corners and such.

The claim that AGG does subpixel rendering (repeated by Mapnik and the OSM wiki) seems to be a mis-translation. I think it just means it does anti-aliasing, that is, how can you represent something smaller than a single pixel? By figuring out if half, or a quarter or a sixteenth of the pixel is one colour or the other and mixing the colours in proportion to get a shade in between. So “less than a pixel” becomes “sub-pixel”, but not meaning the individual RGB pixels that make up a single pixel on your standard LCD.

Personally, as a Mac user, and a Linux user who tweaks his fonts to look like they do on the Mac (i.e. “blurry” to your average Windows users) I think the fonts on Mapnik could look better. I realize though that others would complain about them being blurry if that change was made.

This link here, written by the AGG guy, not only gives you some background on sub-pixel text and the difference of opinion between Mac and PC users, but has some of his own crazy ideas that could perhaps be used to make Mapnik text rendering better for everyone (assuming it’s not already built into AGG and Mapnik. The article is 18 months old)


edit: and here’s the AGG docs talking about what they mean when they say “sub-pixel” (confirming my theory that they just mean good anti-aliasing, not the RGB stuff )


First of all thanks for making everything clear, that wasn’t a trivial translation error. It really sucks when computers terminology is almost the same for different things.

Doesn’t really matter if you rotate the font first… but that is nit picking