antialias() function

William K woklist at CHARTER.NET
Tue Apr 5 18:28:13 EDT 2005


Hm, that's an interesting idea - splitting text and linework.  One
other issue that I forgot about is that for labels outlines are fixed
at 1 pixel.  When that gets scaled back down, it mostly disappears.
This looks like a good way to deal with that.  And let the builtin
text-drawing functions handle text antialiasing.

Yet, I found that the scaled antialiasing method looked better even for
text.  I guess I'm used to high-end graphics antialiasing like is done
in Illustrator and Photoshop.  Freetype falls a little short of that,
but is still pretty good.

As for scaling a normal-size mapfile up, when I first started working
on this method, that's what I started with (manually, not
programmatically), but after fine-tuning a scaled mapfile, found that
odd number in many cases gave better resampled output (ie a 1-pixel
line might look better, in some cases, as 3-pixels scaled up at 2x
instead of 2-pixels).

Also, it doesn't look like it deals with scaling pattern fills or point
symbols based on images.  Or it may (just a quick skim of the code),
but scale an image up, then back down antialiased and it'll look odd.

But I'm sure this will work well for many.  And you don't have to worry
about scaling incoming image coordinates to the scaled mapfile.  Or a
manual scalebar overlay.  With a little tuning, this function could be
really nice.  Eventually, with tuning my mapscript code as I have time,
I'll probably have something similar (I don't know if I'll have a
chance to test your function).

On Apr 5, 2005, at 4:57 PM, Camden Daily wrote:

> I've written a nice php/mapscript antialiasing function and thought
> I'd post it if anybody is looking to add antialiasing.  It uses the
> method of drawing the map at a larger size, then uses php mapscript to
> sample the image back down.  It scales all of the symbols, etc up and
> down as necessary.  It also renders any annotation layers and the
> scalebar seperately and then combines that over the antialiased map so
> the text isn't blurred.  Therefore, you won't have to go through and
> manually scale all of your .map entries or worry about scaling your
> click points or anything.  It's pretty self contained.
>
-----
William Kyngesburye <kyngchaos at charter.net>
http://webpages.charter.net/kyngchaos/

"Time is an illusion - lunchtime doubly so."

- Ford Prefect
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 2378 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapserver-users/attachments/20050405/b9d8233c/attachment.bin


More information about the mapserver-users mailing list