Convert Uint16 -> Byte Image is darker

310 views Asked by At

I want to convert an image with Uint16 pixels to Byte pixels. I'm actually using GDAL library (and gdal_translate command) to do this but the output image is darker than the original

Original image

Output image

Do you know what can i do to convert Uint16 -> Byte without lose this luminosity ? Or can I do something for transform the output image ?

1

There are 1 answers

0
Jan Ruzicka On

You need to specify scale values. For example: gdal_translate -scale 0 4000 -ot Byte input.tif output.tif

If you do not specify the values it takes whole input and scales it to 0 255. But if you specify -scale 0 4000 it takes only part of the input which has significant information in your image.

There are usually some pixels that have too high value that in result produces dark image. The dark pixels do not have enough space in the output.