[gdal-dev] Transparency using gdalbuildvrt

Frank Warmerdam warmerdam at pobox.com
Wed Mar 4 11:11:07 EST 2009


Jason Beverage wrote:
> Hi all,
> 
> I've been playing around with gdalbuildvrt lately and it has proven to 
> be a very useful tool:)
> 
> What I'm attempting to do is take multiple RGB images and treat them as 
> a single image using the VRT.  This works great, but since the images 
> are RGB, areas where there is no data are coming back as black.  Is 
> there a way that I can modify the VRT or the code to treat the VRT as an 
> RGBA dataset and somehow say "If there is no data in any bands, the 
> alpha is 0"?

Jason,

It looks like if there is a nodata value set on the bands in the VRT,
this value will be used in nodata areas.  So it should be possible
to set the otherwise unset areas to be white for instance.

However, I am not aware of any way to have an alpha band that would be
opaque in areas of data and transparent in areas of nodata if the source
images are RGB (not RGBA).

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the gdal-dev mailing list