[gdal-dev] Re: to make black triangle transparent (gdalwarp)

Jukka Rahkonen jukka.rahkonen at mmmtike.fi
Thu Nov 3 11:31:30 EDT 2011

Jean-Claude Repetto <jrepetto <at> free.fr> writes:

> Le 03/11/2011 10:45, Jan Tappenbeck a écrit :
> >
> > i had transform some tif-files by epsg-code so the images will rotate
> > and at the border now some black triangles.
> >
> > now i want to merge by gdalwarp
> Hi,
> Wouldn't it be easier to merge the maps before warping ?

Alternative for alpha is to use nodata value with -dstnodata. At least ddal
based programs will recognise the nodata value and make it transparent.
Mapserver will handle the case if mapfile contains a row OFFSITE. Sometimes
nodata can make also real data transparent, for example water bodies can be
totally black (0 0 0) in  aerial images. Something like totally blue seldomly
appears in real world images and nodata 0 0 255 should be safe. Test it before
use, a long time ago gdal had some bug and it did not support using different R
G B values for offsite but I believe it has been fixed some years ago.

-Jukka Rahkonen-

More information about the gdal-dev mailing list