For a machine vision application, we take short duration (50uSec) monochrome pictures with IR flash. The images we get are decent quality however the light color subjects (light blue, light green, yellow) are all lost or become less visible.

We convert these 10 bit images to 8 bit and look at them that way which already contributes to the problem. This is something we can probably solve with a non-linear 10-8 bit companding, so I am not worried about this part. If I look at the images on a display that supports 10 bit I still see them very very weak. My objective is to boost them.

In the raw data when I look at them, assuming surface average is 800 (pretty white), these light color subjects are 760-780 range, so the info is there but not visible. (A side note, if I take a picture of the same object under normal light with very long exposure time, 1msec, I see all details, so flash is also contributing to the problem).

What is the best way to gain these lost info back? We still have access to the 10 bit raw image data, what type of algorithm I can use to gain them back.

  • $\begingroup$ Have you considered tone mapping? You can use it before quantization to 8 bits to keep most information retained. I think gradient domain or local contrast method gives strong enhancements. Another option is global adjustment using nonlinear mapping (contrast curve). $\endgroup$
    – Libor
    Aug 25, 2012 at 8:03
  • $\begingroup$ @Libor I didn't but I am less concerned about the 10-8 bit mapping. I will implement some sort of non linear mapping that doesn't kill the least significant bits. My worry is even after this operation, the info will be weak or lost. My objective is to boost original 10 bit data. $\endgroup$
    – Ktuncer
    Aug 25, 2012 at 9:52
  • $\begingroup$ Well this is what both remapping and tone mapping does. It will reorder the values in original image such that when quantized to 8 bits, most details are preserved. It can be done in 8 bits as well, but it why to cut off data prior to enhancement. The mapping and quantization can be also brought into a single step. If you post a sample image, I can try few algorithms to recover your data. $\endgroup$
    – Libor
    Aug 25, 2012 at 9:59
  • $\begingroup$ @Libor is there a look up table I can use for 10-8 bit tone mapping. Or a ready made algorithm? I will post the image monday. $\endgroup$
    – Ktuncer
    Aug 26, 2012 at 4:26
  • $\begingroup$ I have added the answer because it was too long for a comment. I will add images if supply them. $\endgroup$
    – Libor
    Aug 26, 2012 at 10:48

1 Answer 1


You can perform tone mapping on the source image and then convert the result to 8 bits.

Global tone mapping

Depends just on pixel values, i.e.

H[x,y] = G(I[x,y])

The output image pixel H[x,y] is just processed input pixel value using tone mapping operator G. This allows making lookup table holding all possible values (i.e. 0 - 1023 in 10-bit images).

Local tone mapping

Works on pixel values and their neighborhood, i.e.

H[x,y] = G(I, x, y)

These operators are more complex in nature, but yield more details in the resulting image.


After applying tone mapping, the image can be converted to 8-bits easily:

O[x,y] = H[x,y] >> 2

Where (>> 2) is shift by two bits, or division by 4.

The conversion can be incorporated in tone mapping step, for example and entry for the look-up table in global tone mapping can be defined this way:

g[i] = (log2(i + 1) * 102.3) >> 1

Note that the operator is a log curve adjusted for range of input values to 0-1023. The operator also contains conversion to 8-bits.


More info on Wikipedia

  • $\begingroup$ Libor, thanks. Is there an easy way to test local tone mapping using matlab? $\endgroup$
    – Ktuncer
    Aug 26, 2012 at 15:56
  • $\begingroup$ I found and inbuild function tonemap. This seems to support adaptive histogram equalization. The requirement is to convert image values in interval <0,1>, perform tonemap and then convert back. Here is a reference to implementation in C with references. You can test the algorithms in LuminanceHDR software. The reason for using this is that the software is able to uncover detail even from single image (no exposure stacking is needed). $\endgroup$
    – Libor
    Aug 26, 2012 at 16:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.