overlaying images using TRANSPARENT=TRUE

I need to overlay WMS images on server-side (PHP). The GetMap requests are using transparent=TRUE parameter; so, it's supposed that at least where there is no symbolized polygon, the image below can be seen without problem.

I'm currently using imagecopymerge command from PHP's GD library as I cannot put all the layers in the same GetMap request (the SLDs are created on the fly based on user params); so I have different images to overlay, each one with his SLD.

As imagecopymerge command only works if you set up opacity parameter for the layer to be overlayed, the resulting image, at the end, loses some brightness.

you can try this URL that overlays two images (resulting of 2 GetMaps):


and this one, just using one image (thats the brightness I wanna have even if I overlay two images)


the worse is that even if there is no symbolization (dynamic SLD) for one of the layers (see URL below, where we add countries border without symbol and transparent=TRUE parameter)...


Is there some solution for that?
someone suggested me to use ImageMagick. Can someone give me an idea if it should work with (or without) ImageMagick?

thanks a lot,

overlaying images using TRANSPARENT=TRUE

thanks for the answer. Yes, have made some easy tests with imagemagick and the final image looks much better.

composite -blend 30 'transp_true.png' 'transp_true2.png' 'composite_test.png'

(blend adds transparency to the layers);



creed's picture

overlaying images using TRANSPARENT=TRUE

Pere -

I am not sure of the answer. Have you tried asking some of the Open Source community groups? Such as MapServer or OSGeo?

I will also ask the OGC community.