[Mapit] Using png

Bernhard Reiter bernhard at intevation.de
Tue Jan 15 22:04:40 CET 2002


Ever woundered about the jpeg artifacts in the rendered maps?

Images in Jpeg format can be created pretty fast, 
but png will feature lossless compression.

If you switch on png support in mapconfig.py, you should 
apply the attached patch (against mapit-1.0) if you want
indexed images. 

This will reduce the size of the created images considerably. 
Check 	www.mapit.de/mapit/herne.de/
and compare it to other example servers still delivering pngs. :)

	Bernhard
-------------- next part --------------
# make sure the image is indexed before delivery
--- makemap.py.org	Tue Jan 15 18:27:01 2002
+++ makemap.py	Tue Jan 15 18:29:07 2002
@@ -150,6 +150,10 @@
 		(1,parameters.height - 1 - s_height), source_image)
         source_image = None
 
+    # make it indexed
+    image = image.convert(mode = 'P', palette = PIL.Image.ADAPTIVE,
+                                      dither = PIL.Image.NONE)
+
     return image

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 248 bytes
Desc: not available
Url : http://www.intevation.de/pipermail/mapit/attachments/20020115/a88b960e/attachment.bin


More information about the Mapit mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)