How to transform a HDR Envi Image into a PNG image (using GDAL)

854 views Asked by At

I am trying to visualize an ENVI image with 4GB by translating it into a PNG image (i.e., a RGB file). According to the .hdr header file, the default bands to do it are: {55, 41, 12}

I am using the gdal_translate, however; I got as response a black image with some blank risks.

I am using the following command line:

gdal_translate -of PNG D:\files\hdr\image D:\file\hdr\test.png -b 55 -b 41 -b 12

What I am doing wrong? I tried to change the order of the bands, to put the option -ot Byte, -ot Uint16, without success...

I have also tried to convert this image by using the java language, but, without success too. If necessary, I can put my source code here too.

Update 1

The complete information of the image is (by using the gdalinfo):

Driver: ENVI/ENVI .hdr Labelled
Files: D:\files\hdr\image
       D:\files\hdr\image.hdr
PROJCS["UTM_Zone_19S",
    GEOGCS["GCS_WGS_1984",
        DATUM["WGS_1984",
            SPHEROID["WGS_84",6378137.0,298.257223563]],
        PRIMEM["Greenwich",0.0],
        UNIT["Degree",0.0174532925199433]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["False_Easting",500000.0],
    PARAMETER["False_Northing",10000000.0],
    PARAMETER["Central_Meridian",-69.0],
    PARAMETER["Scale_Factor",0.9996],
    PARAMETER["Latitude_Of_Origin",0.0],
    UNIT["Meter",1]]
Origin = (320055.641999999990000,6309280.342000000200000)
Pixel Size = (0.500000000000000,-0.500000000000000)
Metadata:
  Band_100=Resize (band*100 refl [%*100]:citricos_02_VNIR_1600_SN0010_raw_rad_atm_geo.bsq) (0.770900)
  Band_101=Resize (band 101 refl [%*100]:citricos_02_VNIR_1600_SN0010_raw_rad_atm_geo.bsq) (0.774500)

......  

[%*100]:citricos_02_VNIR_1600_SN0010_raw_rad_atm_geo.bsq) (0.767300)
  Band_9=Resize (band 9 refl [%*100]:citricos_02_VNIR_1600_SN0010_raw_rad_atm_geo.bsq) (0.440300)
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (  320055.642, 6309280.342) ( 70d56' 0.93"W, 33d20'26.27"S)
Lower Left  (  320055.642, 6308398.842) ( 70d56' 1.56"W, 33d20'54.88"S)
Upper Right (  324115.142, 6309280.342) ( 70d53'23.97"W, 33d20'28.69"S)
Lower Right (  324115.142, 6308398.842) ( 70d53'24.58"W, 33d20'57.30"S)
Center      (  322085.392, 6308839.592) ( 70d54'42.76"W, 33d20'41.79"S)
Band 1 Block=8119x1 Type=UInt16, ColorInterp=Undefined
  Description = Resize (band 1 refl [%*100]:citricos_02_VNIR_1600_SN0010_raw_rad_atm_geo.bsq) (0.411200)
  Metadata:
    wavelength=0.411200
Band 2 Block=8119x1 Type=UInt16, ColorInterp=Undefined
  Description = Resize (band 2 refl [%*100]:citricos_02_VNIR_1600_SN0010_raw_rad_atm_geo.bsq) (0.414800)
  Metadata:
    wavelength=0.414800
...
Band 11 Block=8119x1 Type=UInt16, ColorInterp=Undefined
  Description = Resize (band 11 refl [%*100]:citricos_02_VNIR_1600_SN0010_raw_rad_atm_geo.bsq) (0.447500)
  Metadata:
    wavelength=0.447500
Band 12 Block=8119x1 Type=UInt16, ColorInterp=Undefined
  Description = Resize (band 12 refl [%*100]:citricos_02_VNIR_1600_SN0010_raw_rad_atm_geo.bsq) (0.451200)
  Metadata:
    wavelength=0.451200
....
Band 41 Block=8119x1 Type=UInt16, ColorInterp=Undefined
  Description = Resize (band 41 refl [%*100]:citricos_02_VNIR_1600_SN0010_raw_rad_atm_geo.bsq) (0.556500)
  Metadata:
    wavelength=0.556500
Band 42 Block=8119x1 Type=UInt16, ColorInterp=Undefined
  Description = Resize (band 42 refl [%*100]:citricos_02_VNIR_1600_SN0010_raw_rad_atm_geo.bsq) (0.560200)
  Metadata:
    wavelength=0.560200
....
Band 54 Block=8119x1 Type=UInt16, ColorInterp=Undefined
  Description = Resize (band 54 refl [%*100]:citricos_02_VNIR_1600_SN0010_raw_rad_atm_geo.bsq) (0.603800)
  Metadata:
    wavelength=0.603800
Band 55 Block=8119x1 Type=UInt16, ColorInterp=Undefined
  Description = Resize (band 55 refl [%*100]:citricos_02_VNIR_1600_SN0010_raw_rad_atm_geo.bsq) (0.607400)
  Metadata:
    wavelength=0.607400
...
Band 160 Block=8119x1 Type=UInt16, ColorInterp=Undefined
  Description = Resize (band*160 refl [%*100]:citricos_02_VNIR_1600_SN0010_raw_rad_atm_geo.bsq) (0.988900)
  Metadata:
    wavelength=0.988900

I have omitted some information because of the Body limit.

0

There are 0 answers