mapbox / mapbox-studio-classic

https://www.mapbox.com/mapbox-studio/
BSD 3-Clause "New" or "Revised" License
1.14k stars 229 forks source link

Support 16-bit tiffs #728

Open GretaCB opened 10 years ago

GretaCB commented 10 years ago

Tried uploading a local 16-bit tiff and no good: screen shot 2014-08-26 at 6 31 54 pm

@kapadia suggested scaling the pixel values into 8-bit values before displaying, since computer screens can't display all values in a 16-bit image.

brunosan commented 10 years ago

Rescaling is the best option. For background, almost no instrument actually uses the whole 16 bit range. E.g. Landast 8 is 12bits (0-4096) rescaled to 16bit (actually 0-55000, less than 2^16), so when doing gdal_translate -ot Byte -scale 0 55000 0 255 you are ok. Landsat 7 is 8bit but after LEDAPS is 12 bit, ...

The longer answer is that we could safely cap at 10000 (~of 100% reflectivity, nothing that we usually care reflects more than ~80-100%) or even lower depending on the instrument and using the metadata. This is good becuase we keep as much dynamic range as possible.

GretaCB commented 10 years ago

Notes for myself: