I am trying to convert some ECW files to PNG using the command gdal_translate test.ecw -of png test.png
, but the PNG file comes out grayscale.
How do I produce a colored PNG from an ECW file using this tool?
Output from gdalinfo test.ecw
:
Driver: ECW/ERDAS Compressed Wavelets (SDK 3.x)
Files: test.ecw
Size is 16000, 24000
Coordinate System is:
PROJCRS["ETRS89 / UTM zone 32N",
BASEGEOGCRS["ETRS89",
DATUM["European Terrestrial Reference System 1989",
ELLIPSOID["GRS 1980",6378137,298.257222101,
LENGTHUNIT["metre",1]]],
PRIMEM["Greenwich",0,
ANGLEUNIT["degree",0.0174532925199433]],
ID["EPSG",4258]],
CONVERSION["UTM zone 32N",
METHOD["Transverse Mercator",
ID["EPSG",9807]],
PARAMETER["Latitude of natural origin",0,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8801]],
PARAMETER["Longitude of natural origin",9,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8802]],
PARAMETER["Scale factor at natural origin",0.9996,
SCALEUNIT["unity",1],
ID["EPSG",8805]],
PARAMETER["False easting",500000,
LENGTHUNIT["metre",1],
ID["EPSG",8806]],
PARAMETER["False northing",0,
LENGTHUNIT["metre",1],
ID["EPSG",8807]]],
CS[Cartesian,2],
AXIS["easting",east,
ORDER[1],
LENGTHUNIT["metre",1]],
AXIS["northing",north,
ORDER[2],
LENGTHUNIT["metre",1]],
ID["EPSG",25832]]
Data axis to CRS axis mapping: 1,2
Origin = (448000.000000000000000,6283000.000000000000000)
Pixel Size = (0.125000000000000,-0.125000000000000)
Metadata:
COLORSPACE=MULTIBAND
COMPRESSION_RATE_TARGET=4
VERSION=2
Corner Coordinates:
Upper Left ( 448000.000, 6283000.000) ( 8d 9' 3.88"E, 56d41'17.50"N)
Lower Left ( 448000.000, 6280000.000) ( 8d 9' 6.06"E, 56d39'40.48"N)
Upper Right ( 450000.000, 6283000.000) ( 8d11' 1.41"E, 56d41'18.29"N)
Lower Right ( 450000.000, 6280000.000) ( 8d11' 3.51"E, 56d39'41.27"N)
Center ( 449000.000, 6281500.000) ( 8d10' 3.71"E, 56d40'29.39"N)
Band 1 Block=256x256 Type=Byte, ColorInterp=Undefined
Description = Band #0
Overviews: 8000x12000, 4000x6000, 2000x3000, 1000x1500, 500x750, 250x375
Band 2 Block=256x256 Type=Byte, ColorInterp=Undefined
Description = Band #1
Overviews: 8000x12000, 4000x6000, 2000x3000, 1000x1500, 500x750, 250x375
Band 3 Block=256x256 Type=Byte, ColorInterp=Undefined
Description = Band #2
Overviews: 8000x12000, 4000x6000, 2000x3000, 1000x1500, 500x750, 250x375
Band 4 Block=256x256 Type=Byte, ColorInterp=Undefined
Description = Band #3
Overviews: 8000x12000, 4000x6000, 2000x3000, 1000x1500, 500x750, 250x375
Band 5 Block=256x256 Type=Byte, ColorInterp=Undefined
Description = Band #4
Overviews: 8000x12000, 4000x6000, 2000x3000, 1000x1500, 500x750, 250x375