[gdal-dev] RGB + Grayscale in gdalwarp

Jay Jennings Jennings.Jay at geoeye.com
Tue Oct 11 16:09:02 EDT 2011


Hi folks,
I am trying to merge a grayscale (1-band) image with RGB (3-band) imagery using 'gdalwarp', the hope being that the grayscale image would be converted on-the-fly to RGB by duplicating the one band 3 times, thus ending up still grayscale visually.
But 'gdalwarp' doesn't seem to do that; instead the grayscale image comes out recognizable but dark reddish, as if the one input band is being used as the Red band on output, with the Green and Blue output bands getting all zeroes.

Looking at the 'gdalwarp' documentation, I don't see any options to treat this (admittedly unusual) case as I'm expecting.  Did I miss anything ?

( I see that the 1-band image can be made compatible by preprocessing it like this:
     gdal_translate -b 1 -b 1 -b 1 gray.tif  RGB_still_gray.tif

That will be my fallback if there are no special tricks in 'gdalwarp' )
.........................................................
Jay Jennings
GeoEye, Inc.
(NASDAQ: GEOY)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20111011/3af119c8/attachment-0001.html


More information about the gdal-dev mailing list