-2

I have a TIFF file, looks like this:

**Driver: GTiff/GeoTIFF
Files: quickbird2015.tif
       quickbird2015.tif.aux.xml
Size is 15106, 5106
Coordinate System is:
GEOGCS["unknown",
    DATUM["unknown",
        SPHEROID["unretrievable - using WGS84",6378137,298.257223563]],
    PRIMEM["Greenwich",0],
    UNIT["foot",0.3048]]
Origin = (0.000000000000000,0.000000000000000)
Pixel Size = (12.000000000000000,-12.000000000000000)
Metadata:
  AREA_OR_POINT=Area
  TIFFTAG_XRESOLUTION=1
  TIFFTAG_YRESOLUTION=1
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (   0.0000000,   0.0000000) (  0d 0' 0.01"E,  0d 0' 0.01"N)
Lower Left  (       0.000,  -61272.000) (  0d 0' 0.01"E,Invalid angle)
Upper Right (  181272.000,       0.000) (Invalid angle,  0d 0' 0.01"N)
Lower Right (  181272.000,  -61272.000) (Invalid angle,Invalid angle)
Center      (   90636.000,  -30636.000) (Invalid angle,Invalid angle)
Band 1 Block=15106x1 Type=UInt16, ColorInterp=Red
  Min=0.000 Max=1600.000 
  Minimum=0.000, Maximum=1600.000, Mean=417.902, StdDev=84.773
  Metadata:
    STATISTICS_MAXIMUM=1600
    STATISTICS_MEAN=417.90197603601
    STATISTICS_MINIMUM=0
    STATISTICS_STDDEV=84.772757670204
Band 2 Block=15106x1 Type=UInt16, ColorInterp=Green
  Min=0.000 Max=1756.000 
  Minimum=0.000, Maximum=1756.000, Mean=570.854, StdDev=114.902
  Metadata:
    STATISTICS_MAXIMUM=1756
    STATISTICS_MEAN=570.85403886609
    STATISTICS_MINIMUM=0
    STATISTICS_STDDEV=114.90190934716
Band 3 Block=15106x1 Type=UInt16, ColorInterp=Blue
  Min=0.000 Max=1901.000 
  Minimum=0.000, Maximum=1901.000, Mean=356.139, StdDev=115.901
  Metadata:
    STATISTICS_MAXIMUM=1901
    STATISTICS_MEAN=356.13917758948
    STATISTICS_MINIMUM=0
    STATISTICS_STDDEV=115.90136336507
Band 4 Block=15106x1 Type=UInt16, ColorInterp=Undefined
  Min=0.000 Max=2151.000 
  Minimum=0.000, Maximum=2151.000, Mean=445.623, StdDev=158.418
  Metadata:
    STATISTICS_MAXIMUM=2151
    STATISTICS_MEAN=445.62308850788
    STATISTICS_MINIMUM=0
    STATISTICS_STDDEV=158.41828562429**

How can I convert this image to RGB?

  • If you downvote, please leave a comment, because it may not be clear to the OP. – pLumo Sep 25 '17 at 7:32
  • I don't know why my question been downvoted. If I make something wrong, please leave a comment to let me now at least. – John Joker Sep 25 '17 at 16:14
1

You can use gdal_translate to achieve your desired result:

gdal_translate input.tif output.tif -b 1 -b 2 -b 3
  • Thanks for you anwser, I already tried it before I ask this question. But this output image is too dark and seems like not it's ture color. – John Joker Sep 25 '17 at 16:16
  • How do you view the image? Since your image is 16 bit there may be a "wrong" histogram stretch used in your viewer. But you can also try converting it to 8 bit if you don't need the 16 bit depth for future processing. See this answer for details:gis.stackexchange.com/a/236291/68210 – tallistroan Sep 25 '17 at 16:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.