[gdal-dev] gdal_merge.py -separate failing to create RGB

Lucena, Ivan ivan.lucena at pmldnet.com
Wed Apr 2 08:25:57 EDT 2008


Hi Mattia,

 > * gdal_merge.py -separate t1.tif t2.tif t3.tif -o out.tif*

Have you tried to use [-ot datatype] to enforce changing the data type 
to byte?

Just a thought.

Ivan

mattia wrote:
> Hi folks,
> 
> I have a problem trying to create RGBs with the gdal_merge.py utility...
> 
> Mainly I have some images that I have extracted from HDF4 SDSs and processed
> in TIFF format using ImageMagick...
> 
> Now a sample image as the following gdalinfo output:
> 
> *mattia at mattia-laptop:~/Desktop/rgb$ gdalinfo t2.tif
> Driver: GTiff/GeoTIFF
> Files: t2.tif
> Size is 2708, 9340
> Coordinate System is `'
> Metadata:
>  TIFFTAG_DOCUMENTNAME=AMOD02HKM20070104021601_0_1_band_2_out.tif
>  TIFFTAG_SOFTWARE=ImageMagick 6.3.8 02/18/08 Q16 http://www.imagemagick.org
>  TIFFTAG_XRESOLUTION=72
>  TIFFTAG_YRESOLUTION=72
>  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
> Image Structure Metadata:
>  INTERLEAVE=BAND
> Corner Coordinates:
> Upper Left  (    0.0,    0.0)
> Lower Left  (    0.0, 9340.0)
> Upper Right ( 2708.0,    0.0)
> Lower Right ( 2708.0, 9340.0)
> Center      ( 1354.0, 4670.0)
> Band 1 Block=2708x1 Type=UInt16, ColorInterp=Gray*
> 
> The file size (for the three images I am trying to merge) is about 50MB..
> As you can see its a 16 bit image..
> 
> if I run something like:
> 
> * gdal_merge.py -separate t1.tif t2.tif t3.tif -o out.tif*
> 
> The output image out.tif is still a greyscale where 2 of the bands are
> somehow "not recognized"...
> The gdalinfo on the output tif is:
> 
> *Driver: GTiff/GeoTIFF
> Files: out.tif
> Size is 2708, 9340
> Coordinate System is `'
> Image Structure Metadata:
>   INTERLEAVE=PIXEL
> Corner Coordinates:
> Upper Left  (    0.0,    0.0)
> Lower Left  (    0.0, 9340.0)
> Upper Right ( 2708.0,    0.0)
> Lower Right ( 2708.0, 9340.0)
> Center      ( 1354.0, 4670.0)
> Band 1 Block=2708x1 Type=UInt16, ColorInterp=Gray
> Band 2 Block=2708x1 Type=UInt16, ColorInterp=Undefined
> Band 3 Block=2708x1 Type=UInt16, ColorInterp=Undefined
> *
> 
> Does it have to do with the fact that its a 16 bit image and gdal_merge.py
> doesn't support it?
> With the fact that ImageMagick has corrupted something ?
> Or what exactly is the issue?
> 
> Thanks in advance
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev


More information about the gdal-dev mailing list