Matching brightness of images

Tags: #<Tag:0x00007fb87df20e80> #<Tag:0x00007fb87df20d40>


Dear All,

I have a series of time-lapse images from a microscopy experiment that I would like to process. They are almost identical images, however, there was a problem with the microscope during the experiment and the brightness is not the same on some images. I have to correct this to be able to do further processing.

I tried the code outlined in a previous post using HistogramMatcher:

Unfortunately, it doesn’t work. Here’s the image that I get:

Could someone help how to solve this problem? I have many images, so manual adjustment is not an option.

Basically, I need im_1.tif and im_10.tif to have (roughly) the same brightness/contrast.

Thank you very much!


You will not be able to compensate for the saturated pixels, I am afraid.
Have a look a the histograms of your images.
Best bet is to capture new images.


Thanks for the help. The images are not saturated. I can adjust by hand to obtain the good match between brightness/contrast. The problem comes due to the number of images I have, this would not be economical to do manually.


Good day Adam,

your first sample “im_1.tif”

that is a 16bit image, is definitely over-exposed. Its histogram shows a pronounced peak (Mode = 478825pixels, about 10%) at the maximum possible gray-value 65535 (white):





I am afraid that they are saturated. Look at the frequency of the highest greyscale value.