How do i transparent the balck background of tiff

classic Classic list List threaded Threaded
3 messages Options
OsgEarth_luo OsgEarth_luo
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How do i transparent the balck background of tiff

I wrote a .earth file like this:
 <image name="d20" driver="gdal">
                <url>./map/maps/mizhi_2_transparent_mosaic_group1.tif</url>
                <options>
                <nodata_image>./map/maps/mizhi_2_transparent_mosaic_group1.tif</nodata_image>
                <transparent_color>255 0 225 0.1</transparent_color>
                </options>       
</image>
try to transparent the balck background of mizhi_2_transparent_mosaic_group1.tif,but it desn't work!

gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How do i transparent the balck background of tiff

"transparent_color" is the color you are trying to replace. So for black, set it to 0 0 0 255.

If you are using the osgEarth master branch, you can also use a shader to alter the color -- see glsl.earth for an example of applying a shader to an image layer.
Glenn Waldron / Pelican Mapping
OsgEarth_luo OsgEarth_luo
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How do i transparent the balck background of tiff

Thanks for your reply Glenn.  


I have a new problem. The problem is that when I load an image that is transparent on its own edge, there is a black edge at the edge of the image. Why?
Loading...