[Gdal-dev] gdal_translsate color problem

Suray Ph philippe.suray at market-ip.com
Tue Jul 31 09:11:30 EDT 2007


Hello,

I have several color ortho-photo's of 4000x4000px, i would like to create tiles
of 400x400px. In order to do that, I tried gdal_translate, but I have problems
with the output file: the image is in gray scale, pixels are streched to the
left with a big black band to the right.

Here is info from input file:
C:\TEMP\IGN_Photos\Couleurs>gdalinfo B228022_P72_Y2005_S71.tif
Driver: GTiff/GeoTIFF
Files: B228022_P72_Y2005_S71.tif
Size is 4000, 4000
Origin = (228000.000000000000000,24000.000000000000000)
Pixel Size = (0.500000000000000,-0.500000000000000)
Metadata:
  AREA_OR_POINT=Area
  TIFFTAG_XRESOLUTION=0
  TIFFTAG_YRESOLUTION=0
  TIFFTAG_RESOLUTIONUNIT=1 (unitless)
Corner Coordinates:
Upper Left  (  228000.000,   24000.000) (  2d 2'53.37"E,  0d13'1.37"N)
Lower Left  (  228000.000,   22000.000) (  2d 2'53.37"E,  0d11'56.26"N)
Upper Right (  230000.000,   24000.000) (  2d 3'58.05"E,  0d13'1.37"N)
Lower Right (  230000.000,   22000.000) (  2d 3'58.05"E,  0d11'56.26"N)
Center      (  229000.000,   23000.000) (  2d 3'25.71"E,  0d12'28.82"N)
Band 1 Block=4000x1 Type=Byte, ColorInterp=Red
  Overviews: 800x800
Band 2 Block=4000x1 Type=Byte, ColorInterp=Green
  Overviews: 800x800
Band 3 Block=4000x1 Type=Byte, ColorInterp=Blue
  Overviews: 800x800

Here is the command used:
gdal_translate -of GTiff -projwin 228000 22200 228200 22000
B228022_P72_Y2005_S71.tif .\tiles200\228000-22200-228200-22000.tif

Here is the info from output file:
C:\TEMP\IGN_Photos\Couleurs\tiles200>gdalinfo 228000-22200-228200-22000_3.tif
Driver: GTiff/GeoTIFF
Files: 228000-22200-228200-22000_3.tif
Size is 400, 400
Origin = (228000.000000000000000,22200.000000000000000)
Pixel Size = (0.500000000000000,-0.500000000000000)
Metadata:
  AREA_OR_POINT=Area
  TIFFTAG_XRESOLUTION=0
  TIFFTAG_YRESOLUTION=0
  TIFFTAG_RESOLUTIONUNIT=1 (unitless)
Corner Coordinates:
Upper Left  (  228000.000,   22200.000) (  2d 2'53.37"E,  0d12'2.77"N)
Lower Left  (  228000.000,   22000.000) (  2d 2'53.37"E,  0d11'56.26"N)
Upper Right (  228200.000,   22200.000) (  2d 2'59.84"E,  0d12'2.77"N)
Lower Right (  228200.000,   22000.000) (  2d 2'59.84"E,  0d11'56.26"N)
Center      (  228100.000,   22100.000) (  2d 2'56.61"E,  0d11'59.51"N)
Band 1 Block=400x20 Type=Byte, ColorInterp=Red
Band 2 Block=400x20 Type=Byte, ColorInterp=Green
Band 3 Block=400x20 Type=Byte, ColorInterp=Blue

What is going wrong?
Why the output file is in gray?

Could someone help me?

Thank you for your response.

Regards

Suray Ph.




More information about the Gdal-dev mailing list