I have a GeoTIFF file which displays the following information when running
Band 1 Block=10012x1 Type=Float32, ColorInterp=Gray Description = Layer_1 Min=1638.991 Max=2577.040 Minimum=1638.991, Maximum=2577.040, Mean=2063.003, StdDev=185.546 NoData Value=-3.4028234663852886e+038 Metadata: LAYER_TYPE=athematic STATISTICS_COVARIANCES=34427.3350382379 STATISTICS_MAXIMUM=2577.0400390625 STATISTICS_MEAN=2063.0031636173 STATISTICS_MEDIAN=0 STATISTICS_MINIMUM=1638.9908447266 STATISTICS_MODE=0 STATISTICS_SKIPFACTORX=1 STATISTICS_SKIPFACTORY=1 STATISTICS_STDDEV=185.54604560119
Based on this information, I understand that the minimum and maximum grayscale values are
What I want to do is convert this GeoTIFF to a 16-bit PNG image which shows ~938 (2577-1638) different shades of gray. I'm attempting to achieve this with the following
"c:\Program Files\GDAL\gdal_translate.exe" -outsize 4096 4096 -of PNG -ot UInt16 -scale 1638.991 2577.040 0 65535 "GDAL_IMG_2_GeoTIFF.tif" "GDAL_IMG_2_GeoTIFF.png"
My understanding here is that
-ot UInt16 allows me to create a 16-bit image and
-scale 1638.991 2577.040 0 65535 re-maps the geoTIFF grayscale range to the full 16-bit range (0 - 65535).
This command does indeed produce what appears to be a 16-bit image however when viewing the image properties in irfanView, the
Number of unique colors is showing as 256.
Full bit-depth info:
Is there any step that I have missed here for creating 16-bit PNG's which make use of > 256 shades of gray or perhaps a better method?