[gdal-dev] alpha mask to data value
Even Rouault
even.rouault at mines-paris.org
Wed Apr 2 14:33:47 PDT 2014
Le mardi 01 avril 2014 22:14:11, William Kyngesburye a écrit :
> I've wrestled with various nodata issues in the past, now it's hitting me
> again...
>
> I'm using Photoshop to delete collars on scanned maps, creating an alpha
> mask. GDAL has no problem with this. What I want to do is merge maps
> together (after rectification), then set any remaining nodata areas to
> white, RGB 255,255,255. Just dropping the extra alpha band doesn't work
> because nodata is set to 0,0,0, which is black. The a_nodata option in
> gdal_translate just defines what existing value in the data is nodata.
>
> I tried using gdalwarp with the -dstnodata option which should set nodata
> values in the output to a specific value, but it carries along the alpha
> band and ignores dstnodata.
>
> gdalwarp -dstnodata "255 255 255" in.tif out.tif
> Processing input file in.tif.
> Using band 4 of source image as alpha.
> Using band 4 of destination image as alpha.
You can perhaps try adding -wo INIT_DEST="255,255,255,0"
>
>
> -----
> William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
> http://www.kyngchaos.com/
>
> First Pogril: Why is life like sticking your head in a bucket filled with
> hyena offal? Second Pogril: I don't know. Why IS life like sticking your
> head in a bucket filled with hyena offal? First Pogril: I don't know
> either. Wretched, isn't it?
> -HitchHiker's Guide to the Galaxy
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
--
Geospatial professional services
http://even.rouault.free.fr/services.html
More information about the gdal-dev
mailing list