<div dir="ltr">We've considered vector tiles but the problem is that (just like image tiles) they would involve a lot of redrawing and would require a high bandwidth.<div><br></div><div>We envision something like 'color cycling' which is sometimes used in graphics: see <a href="http://www.effectgames.com/demos/canvascycle/?sound=0">http://www.effectgames.com/demos/canvascycle/?sound=0</a> .</div><div><br></div><div>It's a bit like coloring books: you specify a palette (1=red, 2=yellow and so on), and if you decide you want different colors, you erase the colors that need to be changed and color them in again with the new color - no need to have a new book shipped to you, or even to color the entire page if some colors are unchanged.</div><div><br></div><div>Of course, a coloring book is not very useful if it specifies numbers that are not in the palette, or (worse) if some numbers exist in the palette but are just wrong (you don't want to color part of Belle's dress with the color that was meant for Ariel's hair).</div><div><br></div><div>On a more technical note, we get pretty far by filtering out the pixels with alpha != 255 (see screenshots) but some incorrect pixels remain. Ideally, we would like to preserve some kind of anti-aliasing but we need about 22 bits just to encode the road segments, not sure how that would work.</div><div><br></div><div>As for Andreas' remark about '<span style="font-size:12.8px">simply the use of another scanline rasterizer.' - I'm sorry but I'm not much of a C++ developer. If I have to do rasterizing, I'd skip MapServer altogether and generate the PNG in Java.</span></div><div><br></div><div>Thanks.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 17, 2017 at 4:53 AM, Eichner, Andreas - SID <span dir="ltr"><<a href="mailto:Andreas.Eichner@sid.sachsen.de" target="_blank">Andreas.Eichner@sid.sachsen.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'd guess it's simply the use of another scanline rasterizer. The demo<br>
  <a href="http://www.antigrain.com/demo/rasterizers.cpp.html" rel="noreferrer" target="_blank">http://www.antigrain.com/demo/<wbr>rasterizers.cpp.html</a><br>
is an example of drawing as polygon aliased and anti-aliased side by side.<br>
<br>
<br>
> -----Ursprüngliche Nachricht-----<br>
> Von: mapserver-users [mailto:<a href="mailto:mapserver-users-bounces@lists.osgeo.org">mapserver-users-<wbr>bounces@lists.osgeo.org</a>] Im<br>
> Auftrag von Richard Greenwood<br>
> Gesendet: Dienstag, 17. Oktober 2017 03:44<br>
> An: Erik H<br>
> Cc: <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.<wbr>org</a><br>
> Betreff: Re: [mapserver-users] Draw roads WITHOUT anti-aliasing<br>
<span class="">><br>
> On Mon, Oct 16, 2017 at 1:23 PM, Erik H <<a href="mailto:erik.h11.01@gmail.com">erik.h11.01@gmail.com</a>> wrote:<br>
><br>
><br>
>       I don't think we have much use for lines that are one pixel wide.<br>
><br>
>       I'm surprised at how difficult this is; isn't there some driver<br>
> other than AGG/PNG I could use?<br>
><br>
><br>
> In mapserver versions before 7.0 there is the GD driver. I use it for 8<br>
> bit GIFs. Not sure what it does with 24 images.<br>
><br>
> Rich<br>
><br>
><br>
><br>
><br>
><br>
><br>
>       On Mon, Oct 16, 2017 at 2:50 PM, Lime, Steve D (MNIT)<br>
> <<a href="mailto:steve.lime@state.mn.us">steve.lime@state.mn.us</a>> wrote:<br>
><br>
><br>
>               So you really do need 24-bit output. I was looking back<br>
> through the mailing list archives and it was mentioned back in 2012 that<br>
> aliased output could be implemented for simple (1 pixel-wide) lines and<br>
> polygons – so there is hope but I don’t believe (looking through the<br>
> source) that Thomas ever fully implemented it. In mapagg.cpp there are<br>
> ifdef’s for a symbol named AGG_ALIASED_ENABLED which makes me wonder if<br>
> work was started. I tried setting that in mapagg.cpp but ran into<br>
> compile errors and didn’t try and track those down.<br>
><br>
><br>
><br>
>               Of course you’d have to live with 1 pixel wide lines…<br>
><br>
><br>
><br>
>               Steve<br>
><br>
><br>
><br>
>               From: Erik H [mailto:<a href="mailto:erik.h11.01@gmail.com">erik.h11.01@gmail.com</a>]<br>
>               Sent: Monday, October 16, 2017 1:15 PM<br>
>               To: Lime, Steve D (MNIT) <<a href="mailto:steve.lime@state.mn.us">steve.lime@state.mn.us</a>><br>
</span>>               Cc: <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.<wbr>org</a> <mailto:<a href="mailto:mapserver-">mapserver-</a><br>
> <a href="mailto:users@lists.osgeo.org">users@lists.osgeo.org</a>><br>
<span class="">>               Subject: Re: [mapserver-users] Draw roads WITHOUT anti-<br>
> aliasing<br>
><br>
><br>
><br>
>               Thanks for your reply, but I should have mentioned that I<br>
> have a LOT of different colors to be displayed, almost a million...<br>
><br>
><br>
><br>
>               I should also have mentioned that I've already tried to<br>
> filter out the anti-aliased pixels by setting all alpha bytes to 255 and<br>
> then assuming that all pixels that don't have alpha=255 in the PNG can<br>
> be removed, but that assumption seems to be wrong.<br>
><br>
><br>
><br>
>               On Mon, Oct 16, 2017 at 2:00 PM, Lime, Steve D (MNIT)<br>
> <<a href="mailto:steve.lime@state.mn.us">steve.lime@state.mn.us</a>> wrote:<br>
><br>
>                       Hmmm… I wonder if you just could use a pre-computed<br>
> palette to control quantizing to 8 bits. You can supply a palette file<br>
> (RGB or RGBA) and the MapServer will map 24/32-bit values to those in<br>
> the palette. Format options are:<br>
><br>
><br>
><br>
>                            FORMATOPTION "PALETTE_FORCE=TRUE"<br>
><br>
>                           FORMATOPTION "PALETTE=palette.txt"<br>
><br>
><br>
><br>
>                       This will definitely limit the colors in your output<br>
> image to those you specify. The question is whether or not the anti-<br>
> aliased colors will map to the right color and that will depend on your<br>
> palette. I did write a simple test with a 5 color palette (black, white,<br>
> red, green and blue) and it seems to work ok but that’s a very simple<br>
> palette… Based on your application it might work though.<br>
><br>
><br>
><br>
>                       -          <a href="http://maps1.dnr.state.mn.us/cgi-" rel="noreferrer" target="_blank">http://maps1.dnr.state.mn.us/<wbr>cgi-</a><br>
> bin/mapserv70?map=/usr/local/<wbr>mapserver/apps/test/palette/<wbr>test.map&mode=m<br>
</span>> ap <<a href="http://maps1.dnr.state.mn.us/cgi-" rel="noreferrer" target="_blank">http://maps1.dnr.state.mn.us/<wbr>cgi-</a><br>
> bin/mapserv70?map=/usr/local/<wbr>mapserver/apps/test/palette/<wbr>test.map&mode=m<br>
> ap>  (24-bit)<br>
><br>
>                       -          <a href="http://maps1.dnr.state.mn.us/cgi-" rel="noreferrer" target="_blank">http://maps1.dnr.state.mn.us/<wbr>cgi-</a><br>
> bin/mapserv70?map=/usr/local/<wbr>mapserver/apps/test/palette/<wbr>test.map&mode=m<br>
> ap&map.imagetype=png8 <<a href="http://maps1.dnr.state.mn.us/cgi-" rel="noreferrer" target="_blank">http://maps1.dnr.state.mn.us/<wbr>cgi-</a><br>
> bin/mapserv70?map=/usr/local/<wbr>mapserver/apps/test/palette/<wbr>test.map&mode=m<br>
> ap&map.imagetype=png8>  (8-bit w/5 colors)<br>
<span class="">><br>
><br>
><br>
>                       Steve<br>
><br>
><br>
><br>
>                       From: mapserver-users [mailto:<a href="mailto:mapserver-users-">mapserver-users-</a><br>
</span>> <a href="mailto:bounces@lists.osgeo.org">bounces@lists.osgeo.org</a> <mailto:<a href="mailto:mapserver-users-bounces@lists.osgeo.org">mapserver-users-<wbr>bounces@lists.osgeo.org</a>><br>
<span class="">> ] On Behalf Of Erik H<br>
>                       Sent: Monday, October 16, 2017 10:58 AM<br>
</span>>                       To: <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.<wbr>org</a> <mailto:<a href="mailto:mapserver-">mapserver-</a><br>
> <a href="mailto:users@lists.osgeo.org">users@lists.osgeo.org</a>><br>
<span class="">>                       Subject: [mapserver-users] Draw roads WITHOUT anti-<br>
> aliasing<br>
><br>
><br>
><br>
>                       I'm running a tiling server that uses MapServer 7.0.4<br>
> to generate PNGs.<br>
><br>
><br>
><br>
>                       My colleagues came up with an ingenious idea to animate<br>
> traffic conditions that would require them to identify road segments<br>
> based on their color. They asked me to generate tiles with a<br>
> predetermined RGBA value per road segment.<br>
><br>
><br>
><br>
>                       I configured a layer of type LINE, with a STYLE section<br>
> containing 'COLOR [palette]' (palette being a field in the database<br>
> query). Initially, I thought I was creating the images my colleagues<br>
> needed, but it seems that the anti-aliasing causes some pixels to have<br>
> colors other than the one I specified; this prevents us from identifying<br>
> the road segments.<br>
><br>
><br>
><br>
>                       We can live without anti-aliasing, but I was unable to<br>
> turn it off; I tried both the AGG/PNG and GD/PNG drivers and messed with<br>
> various FORMATOPTION identifiers, but nothing seemed to make any<br>
> difference.<br>
><br>
><br>
><br>
>                       Any suggestions?<br>
><br>
><br>
><br>
>                       Thanks.<br>
><br>
><br>
><br>
><br>
><br>
>       ______________________________<wbr>_________________<br>
>       mapserver-users mailing list<br>
</span>>       <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.<wbr>org</a> <mailto:<a href="mailto:mapserver-">mapserver-</a><br>
> <a href="mailto:users@lists.osgeo.org">users@lists.osgeo.org</a>><br>
>       <a href="https://lists.osgeo.org/mailman/listinfo/mapserver-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/mapserver-<wbr>users</a><br>
<div class="HOEnZb"><div class="h5">> <<a href="https://lists.osgeo.org/mailman/listinfo/mapserver-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/mapserver-<wbr>users</a>><br>
><br>
><br>
><br>
><br>
><br>
> --<br>
><br>
> Richard W. Greenwood, PLS<br>
> <a href="http://www.greenwoodmap.com" rel="noreferrer" target="_blank">www.greenwoodmap.com</a><br>
</div></div></blockquote></div><br></div>