Try to use this configurations on convert command:

convert -format PNG8 -alpha Off -quality 90% -colors 31 -depth 6 input.png output.png

You can change the values of quality, colors and depth to reduce the diference of the colors of the new file.

With this configuration I reduce the file size (256x256) 75Kb to 16Kb...

BRUNO CAPONI

Alireza Kashian wrote:
> Hi.
>
> One of the things I have been always looking for is the method for
> enhancing PNG sizes made by mapnik.
> Right now, each map tile (250x250px) is by average 90Kbyte (PNG-24bit)  
> in city centers..(where we have POIs, roads and other colorful features.).
>
> This file size is not suitable for web mapping. I checked google maps
> and in those crowded areas, the size of PNGs are maximm 12Kbyte !!
>
> One way is to use PNG256 in mapnik. But since we use Tilecache for
> generating the tiles, Metatile does not support PNG256 and if we turn
> metatile off, then the we loose the texts on edges and even speed for
> making tiles is much less. our maps are full screen, so 7x4=28 tiles per
> view.
>
> I even made PNG256 with mapnik alone and still the size is around 25 to
> 30Kbyte ...!    comparing to gooogle, it is double or more..
> I used Photoshop "save for web" feature and chose Web Snap option in
> save menue...the result PNG is like 9Kbyte !!!
>
> I used Convert function in ImageMagick and tried to set it for lowest
> possible quality and even ImageMagick can't make 9Kbyte PNG...it could
> make it like 22Kbyte... I don't know what Photoshop does..is it a hidden
> algorithm?
>
> So I am still looking for possible Batch optimization of 600,000 PNGs
> which are created by mapnik/tilecache.
>
> We usually update our maps every week and we need to find a solution for
> that.
>
> Anyone has experience on methods and tips for enhancing the sizes? it is
> a matter of giga bytes of transfer per day.....
>
> thanks.
> Alireza
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Mapnik-users mailing list
> [email protected]
> https://lists.berlios.de/mailman/listinfo/mapnik-users

_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to