Transparent PNG files...

Stephen Woodbridge woodbri at SWOODBRIDGE.COM
Tue Apr 19 09:38:30 EDT 2005


Dan,

With my very limited experience working with images and photoshop you
need to make sure that you save set the image as having a transparent
background and select the index before you file it.

Then you need to tell mapserver in the symbol definition what index is
also transparent.

I don't think it will work it create a normal (non transparent) image
and then tell mapserver to treat some index value is transparent.

I have attached a transparent png image where I use "transparent 1" in
my symbol def. try replacing your tree with it and see if that works.

-Steve

Dan Taylor wrote:
> Following up from another thread, I'm currently attempting to show
> woodland as a polygon filled with tree images.  It has been suggested
> to me that I use two or more transparent images to fill the polygon
> and get the effect I want.  However, I have hit another problem.
>
> I get the warning: "Warning: [MapServer Error]: loadSymbol(): Unable
> to load GIF symbol" when I try to load a gif image using the following
> in my map file:
>
> SYMBOL
>   NAME 'tree3'
>   TYPE pixmap
>   TRANSPARENT 127
>   IMAGE 'symbols/trees.gif'
> END
>
> If I try to use a PNG image it won't go transparent.  Using Paint Shop
> pro I have examined the palette to find the index of the colour I want
> to be transparent (white), so as far as I know it's correct.  The
> image ends up looking wrong.  See mapfile snippet and link for
> example.
>
> SYMBOL
>   NAME 'tree4'
>   TYPE pixmap
>   TRANSPARENT 0
>   IMAGE 'symbols/trees2.png'
> END
>
> http://logicalgenetics.com/assorted/upload/output_not_working.jpg
>
> So I have two questions...
>
> 1)  Can transparent PNG images be used and if so, how?
>
> 2)  Why can my version of mapserver not load GIF images?  Do I need to
> compile something extra in?
>
> Very best,
>
> Dan
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ushwy.png
Type: image/png
Size: 221 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapserver-users/attachments/20050419/653a1597/ushwy.png


More information about the mapserver-users mailing list