[MS4W-Users] [ms4w-users] agg + transparency + quantize not working

Tiemens, Gerben Gerben.Tiemens at grontmij.nl
Thu Nov 5 12:01:06 EST 2009


Further research drills down to where the problem may occur:

If i test my saved mapfile from mapscript into the apache/cgi-bin/mapserv.exe
The image is coming out as it should be.
Transparent background, features like it should be, and text also as it should be.


Am i doing something wrong in mapscript? Are there configurations that I may miss in mapscript that are default in mapserv.exe?

I also don't know if this is a problem of Mapserver or MS4W, therefore crossposting it.

Greetings

Gerben


Grontmij
Gerben Tiemens
GIS adviseur/ontwikkelaar GIS & ICT
Grontmij Nederland B.V.
B De Holle Bilt 22, 3732 HM De Bilt
P Postbus 203, 3730 AE De Bilt
M +31 61 334 5944
T +31 30 220 7440
F +31 30 220 1923
E  Gerben.Tiemens at Grontmij.nl
W http://www.grontmij.nl
Handelsregister 30129769


-----Oorspronkelijk bericht-----
Van: Tiemens, Gerben
Verzonden: Thursday, November 05, 2009 4:21 PM
Aan: Tiemens, Gerben; ms4w-users at lists.maptools.org
Onderwerp: RE: [MS4W-Users] [ms4w-users] agg + transparency + quantize not working



In addition to previous email :  further testing revealed that the transparent color is always black.
So if I set

imagecolor 99 99 99
transparent = true

And outputformat to:
OUTPUTFORMAT
    NAME "PNG_mapscript"
    MIMETYPE "image/png"
    DRIVER "GD/PNG"
    EXTENSION "PNG"
    IMAGEMODE "RGBA"
    TRANSPARENT TRUE
    FORMATOPTION "QUANTIZE_FORCE=on"
    FORMATOPTION "QUANTIZE_COLORS=256"
    FORMATOPTION "QUANTIZE_NEW=on"
 END

The image appears grey.
The black labels with white backgroundcolor and black shadowcolor in original image are mapped to: white background with gray outline characters and transparent filling and the shadow is grayoutlined with transparent filling. Probably the antialiasing generates the grey outline, the black filling is converted to transparent.

Something is going wrong.


If I set output format to:

 OUTPUTFORMAT
    NAME "PNG_mapscript"
    MIMETYPE "image/png; mode=24bit"
    DRIVER "AGG/PNG"
    EXTENSION "PNG"
    IMAGEMODE "RGBA"
    TRANSPARENT TRUE
    FORMATOPTION "QUANTIZE_FORCE=on"
    FORMATOPTION "QUANTIZE_DITHER=off"
    FORMATOPTION "QUANTIZE_COLORS=256"
  END

The same applies for the text/labels,  but background of the image is now black in all circumstances (no matter what color of imagecolor setting.


Greetings
Gerben


-----Oorspronkelijk bericht-----
Van: ms4w-users-bounces at lists.maptools.org [mailto:ms4w-users-bounces at lists.maptools.org] Namens G. Tiemens
Verzonden: Thursday, November 05, 2009 1:46 PM
Aan: ms4w-users at lists.maptools.org
Onderwerp: [MS4W-Users] [ms4w-users] agg + transparency + quantize not working


I am busy writing a application with mapscript in C#.

Currently I am facing the earlier mentioned problems of agg + transparent images + quantization.
Is the new MS4W compiled with the quantization options?

The image background is now Black. The labels are dissapearing.
It should be an image wich is completly transparent with some colored lines and some black labels.

Setting the imagecolor will not help me.
Images without quantization options on, are perfect and beautiful png's.


What I am using now is this:
MS4W 3.0 Beta 7
C# mapscript


Mapfile is completely written in C#, so all default options apply.
I saved

MAP
  EXTENT 104952 495303 105452 495803
  IMAGECOLOR 255 255 255
  IMAGETYPE gif
  SIZE 2000 2000
  STATUS ON
  UNITS METERS
  NAME "MS"

  OUTPUTFORMAT
    NAME "PNG_mapscript"
    MIMETYPE "image/png; mode=24bit"
    DRIVER "AGG/PNG"
    EXTENSION "PNG"
    IMAGEMODE "RGBA"
    TRANSPARENT TRUE
    FORMATOPTION "QUANTIZE_FORCE=on"
    FORMATOPTION "QUANTIZE_DITHER=off"
    FORMATOPTION "QUANTIZE_COLORS=256"
  END

  SYMBOL
    NAME "circle"
    TYPE ELLIPSE
    FILLED TRUE
    POINTS
      1 1
    END
  END
--
*snip*
--
END








--
View this message in context: http://old.nabble.com/agg-%2B-transparency-%2B-quantize-not-working-tp26213640p26213640.html
Sent from the ms4w-users mailing list archive at Nabble.com.

_______________________________________________
MS4W-Users mailing list
MS4W-Users at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/ms4w-users

<< Please read our E-mail Disclaimer at: Emaildisclaimer.Grontmij.com >>


More information about the MS4W-Users mailing list