[MS4W-Users] WMS imagery has transparent pixels

Tiemens, Gerben Gerben.Tiemens at grontmij.nl
Fri Jan 22 05:05:26 EST 2010




Did you solve the problem already? When I access your WMS, it has no transparency anymore, with using png.
Even with parameter for wms Transparent=true it does not show transparent pixels..


For testing I used this HTML, so you can easily see it works, because I specified black background, transparent would be black, this is not the case with these clouds:

<html xmlns="http://www.w3.org/1999/xhtml">
        <head>
        </head>
        <body>
                <div style="width:1015px;height:795px;background-color:black;" id="map"><img src= "http://mapservertest.maine.gov/wms/mapserv.exe?map=c:/wms/orthos.map&SERVICE=WMS&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&BBOX=-68.916164,45.940735,-68.866133,45.979912&SRS=EPSG:4326&WIDTH=1015&HEIGHT=795&LAYERS=Baxter_04%2CBaxter_04_5m%2CBaxter_04_25m&STYLES=%2C%2C&FORMAT=image/png&DPI=96&TRANSPARENT=TRUE"/></div>
        </body>
</html>

Greets
Gerben

-----Oorspronkelijk bericht-----
Van: ms4w-users-bounces at lists.maptools.org [mailto:ms4w-users-bounces at lists.maptools.org] Namens Smith, Michael
Verzonden: Thursday, January 21, 2010 8:43 PM
Aan: ms4w-users at lists.maptools.org
Onderwerp: Re: [MS4W-Users] WMS imagery has transparent pixels

Thanks Karsten,

But what I am trying to achieve is to have the 255 255 255 pixels NOT transparent, they are already transparent and I need the opposite (they are clouds in aerial photos and where they are totally white, there are holes right through to whatever's underneath).

Also according to the MS documentation, TRANSPARENT will not work with RGB (would need to use RGBA).  I did try that, with TRANSPARENT=OFF and IMAGEMODE=RGBA, no change in behavior.

Regarding JPEG, we found initially that certain clients would not accept JPEGs from WMS, and that is why we use PNG.  It seems the most widely supported.

Other suggestions


**********
Michael Smith
State GIS Manager
Maine Office of GIS
State House Station 174
264 Civic Center Drive
Augusta ME 04333-0174
(207) 215-5530

-----Original Message-----
From: karsten vennemann [mailto:karsten at terragis.net]
Sent: Thursday, January 21, 2010 12:28 PM
To: ms4w-users at lists.maptools.org
Cc: Smith, Michael
Subject: RE: [MS4W-Users] WMS imagery has transparent pixels

Try setting  FORMATOPTION "TRANSPARENT=ON" in your outputformat declaration and choose an image type that supports transparency like png.
does
 OUTPUTFORMAT
   NAME "AGGPNG24"
   DRIVER "AGG/PNG"
   MIMETYPE "image/png"
   EXTENSION PNG
   IMAGEMODE RGB
   FORMATOPTION "INTERLACE=OFF"
   FORMATOPTION "TRANSPARENT=ON"
 END
work ?

Note: I had usually the opposite problem with vector layers and WMS when I set color to 255 255 255 that as WMS renders then transparent. In that acse with vectors and one can set color 254 254 254 instead and it will render fine (white).

Karsten

Cheers
Karsten

Karsten Vennemann
Principal

Terra GIS LTD
Seattle, WA, USA
www.terragis.net



_______________________________________________
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