I have panchromatic images taken from a remote senescing device, and it is downloaded as a raw which is dark/ underexposed (as 1st pic), hence it needs enhancement in brightness and contrast to be readable. I usually enhance it visually using auto level then modify the parameters to be not that highly contrasted. (as 2nd pic)

My question: is there an approach or a way to follow where I can have the ideal output in terms of brightness/contrast. and would you recommend measuring the contrast to check the quality?

What I need is a systematic approach to have a good output and in the same time not to loose the data.

Aslo, in this case, what values should be adjusted, is it brightness and contast, or exposure and gamma.

non enhanced enhanced

  • $\begingroup$ You are looking for histogram equalization...dsp.stackexchange.com/q/85977/34391 can also review the Wikipedia article on this topic $\endgroup$ Jul 31, 2023 at 15:47
  • $\begingroup$ What is the goal? Is it just for visual exploration (for which histogram equalization is great) or do you need to do other things with the data (in which case histogram equalization is destructive)? $\endgroup$ Aug 1, 2023 at 14:28
  • $\begingroup$ the purpose to make these data useful and readable in terms of extracting information later, like classification for example. $\endgroup$
    – gin
    Aug 1, 2023 at 19:44

1 Answer 1


Check the information about histogram equalization. Matlab code can be found here:


Or, in Python:



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.