[Gdal-dev] gdalwarp nodata

Richard Greenwood richard.greenwood at gmail.com
Sat Nov 13 14:27:30 EST 2004


On Sat, 13 Nov 2004 14:13:47 -0500, Frank Warmerdam <warmerdam at pobox.com> wrote:
> Richard Greenwood wrote:
> > So would gdalwarp recognize an alpha channel, or would I specify
> > additional options? I am not too familiar with the use of alpha
> > channels is it  0->255 corresponding to transparent->opaque?
> >
> > Yes, an example script would be wonderful, but I don't mean to impose on you.
> 
> Rich,
> 
> OK I have attached a little script that takes in an RGB file, and outputs
> an RGBA file with alpha set to transparent(0) where the condition is met, and
> to opaque(255) where it isn't set.

Thank you!

> However, to my dismay I find that gdawarp does *not* honour alpha values
> coming from the source image so this doesn't do you too much good. 

That confirms what I am experiencing also.

> You
> could use a slight variation on this script to alter all pixels that
> have red, green or blue values of 255 for pixels where everything isn't 255 to
> use 254 instead.  Then the existing gdalwarp -srcnodata support should work
> properly.

I'll play with that.

> I, on the other hand, will now have to tie in the alpha blending support
> properly in gdalwarp. If you aren't in a hurry you might just want to wait
> for that to be complete.

I'll keep an eye out for that. Ultimately that seems like the most
desirable solution.

As always, thank you very much for all of your help.

Rich

-- 
Richard Greenwood
richard.greenwood at gmail.com
www.greenwoodmap.com



More information about the Gdal-dev mailing list