I do get something now and the bands are geting filled but the output image looses way too much detail...<br>It is all white basically with some blue, yellow and red patterns here and there.. very strange ... <br><br>here is the gdalinfo:<br>
<br>Driver: GTiff/GeoTIFF<br>Files: out2.tif<br>Size is 2708, 9340<br>Coordinate System is `'<br>Image Structure Metadata:<br> INTERLEAVE=PIXEL<br>Corner Coordinates:<br>Upper Left ( 0.0, 0.0)<br>Lower Left ( 0.0, 9340.0)<br>
Upper Right ( 2708.0, 0.0)<br>Lower Right ( 2708.0, 9340.0)<br>Center ( 1354.0, 4670.0)<br>Band 1 Block=2708x1 Type=Byte, ColorInterp=Red<br>Band 2 Block=2708x1 Type=Byte, ColorInterp=Green<br>Band 3 Block=2708x1 Type=Byte, ColorInterp=Blue<br>
<br><br>I have a feeling that it is actually the gdal_merge.py utility that does not work with 16 bit integer images<br><br>The following explains my conclusion; if I extract my band greyscale images with the following command:<br>
<br><b>gdal_translate -ot Byte -scale -co "INTERLEAVE=BAND" -b 1 HDF4_SDS:UNKNOWN:"AMOD02HKM20070104021601.hdf":0 b1.tif<br><br></b>And the same for bands 2 and 3 for example <br><br>I get a downscale from 16 bit to 8 bit integers...<br>
<br>If I now call gdal_merge.py on these 3 bands, I get a proper RGB image<br><br><br>But,<br><br>If I do the band extraction with :<br><br><b>gdal_translate -co "INTERLEAVE=BAND" -b 1 HDF4_SDS:UNKNOWN:"AMOD02HKM20070104021601.hdf":0 b1.tif</b><br>
<br><br>ie: not downscaling and leaving the pixel sizes as 16 bit integers.. Then I try merging, I dont get any RGB image...<br><br>Is my conclusion right?<br><br><br><br><br><br><br><br><br><br><br><div class="gmail_quote">
On Wed, Apr 2, 2008 at 9:25 AM, Lucena, Ivan <<a href="mailto:ivan.lucena@pmldnet.com">ivan.lucena@pmldnet.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Mattia,<br>
<br>
> * gdal_merge.py -separate t1.tif t2.tif t3.tif -o out.tif*<br>
<br>
Have you tried to use [-ot datatype] to enforce changing the data type to byte?<br>
<br>
Just a thought.<br>
<br>
Ivan<br>
<br>
mattia wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div></div><div class="Wj3C7c">
Hi folks,<br>
<br>
I have a problem trying to create RGBs with the gdal_merge.py utility...<br>
<br>
Mainly I have some images that I have extracted from HDF4 SDSs and processed<br>
in TIFF format using ImageMagick...<br>
<br>
Now a sample image as the following gdalinfo output:<br>
<br>
*mattia@mattia-laptop:~/Desktop/rgb$ gdalinfo t2.tif<br>
Driver: GTiff/GeoTIFF<br>
Files: t2.tif<br>
Size is 2708, 9340<br>
Coordinate System is `'<br>
Metadata:<br>
TIFFTAG_DOCUMENTNAME=AMOD02HKM20070104021601_0_1_band_2_out.tif<br>
TIFFTAG_SOFTWARE=ImageMagick 6.3.8 02/18/08 Q16 <a href="http://www.imagemagick.org" target="_blank">http://www.imagemagick.org</a><br>
TIFFTAG_XRESOLUTION=72<br>
TIFFTAG_YRESOLUTION=72<br>
TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)<br>
Image Structure Metadata:<br>
INTERLEAVE=BAND<br>
Corner Coordinates:<br>
Upper Left ( 0.0, 0.0)<br>
Lower Left ( 0.0, 9340.0)<br>
Upper Right ( 2708.0, 0.0)<br>
Lower Right ( 2708.0, 9340.0)<br>
Center ( 1354.0, 4670.0)<br>
Band 1 Block=2708x1 Type=UInt16, ColorInterp=Gray*<br>
<br>
The file size (for the three images I am trying to merge) is about 50MB..<br>
As you can see its a 16 bit image..<br>
<br>
if I run something like:<br>
<br>
* gdal_merge.py -separate t1.tif t2.tif t3.tif -o out.tif*<br>
<br>
The output image out.tif is still a greyscale where 2 of the bands are<br>
somehow "not recognized"...<br>
The gdalinfo on the output tif is:<br>
<br>
*Driver: GTiff/GeoTIFF<br>
Files: out.tif<br>
Size is 2708, 9340<br>
Coordinate System is `'<br>
Image Structure Metadata:<br>
INTERLEAVE=PIXEL<br>
Corner Coordinates:<br>
Upper Left ( 0.0, 0.0)<br>
Lower Left ( 0.0, 9340.0)<br>
Upper Right ( 2708.0, 0.0)<br>
Lower Right ( 2708.0, 9340.0)<br>
Center ( 1354.0, 4670.0)<br>
Band 1 Block=2708x1 Type=UInt16, ColorInterp=Gray<br>
Band 2 Block=2708x1 Type=UInt16, ColorInterp=Undefined<br>
Band 3 Block=2708x1 Type=UInt16, ColorInterp=Undefined<br>
*<br>
<br>
Does it have to do with the fact that its a 16 bit image and gdal_merge.py<br>
doesn't support it?<br>
With the fact that ImageMagick has corrupted something ?<br>
Or what exactly is the issue?<br>
<br>
Thanks in advance<br>
<br>
<br>
<br>
<br></div></div>
------------------------------------------------------------------------<br>
<br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote>
</blockquote></div><br><br clear="all"><br>-- <br>Mattia