This is a medically related question...Most pathology slides are stained with hematoxylin (blue) and eosin (red). However, every lab does it differently. I would like to take a bunch of images from various sources and get the staining properties to all be about the same--with some automatable process, since I have 100's of images to deal with.

Any theories?



  • 2
    I'd convert all the images to grey-scale then apply a red or blue hue. Can you provide us with some example slides so we can get a better idea of what you're working with? – JohnB Jun 15 '13 at 21:22
  • After googling those foreign words, I think I originally misunderstood the problem. Example slides would definitely give me a better idea of what it is you're trying to do – JohnB Jun 15 '13 at 21:26

Match colors with Gimp

Adjusting the colors of histology slides is not an easy task as we are faced with a great variation not only in staining quality but also in heterogeneous staining of different tissues, and from a great variation of color temperature from the microscope light source. This is further aggravated by poor contrasting of the raw images that come from settings of the various microscope cameras on the market.

Nevertheless we do have to normalize these images for print or for presentations to reduce the color variations as can be seen from examples below (random Google image search):

enter image description here enter image description here enter image description here enter image description here

To show the effects of color normalization I deliberately did not adjust the overall image brightness and contrast. This of course should have been done before we normalize colors (see example below).

FX-foundry color match

With a default installation of Gimp we have access to FX-Foundry scripts. It is the effect "Fx-foundry - Colors - Match Color..." effect which allow to match colors to a reference image. This effect is fast, and can also be used in batch processing to give reasonably good results:

Reference image used:

enter image description here

Resulting color match using FX-foundry script:

enter image description here enter image description here enter image description here enter image description here

We can see that there is a far better color match between the slides now. We can also see, that further adjustment of contrast enhancement for better results would be needed in addition.

Adjust contrast before color processing

Below is an automatic filter "Colors - Auto - Stretch Contrast" from Gimp I had added before color normalization on one of the images above:

enter image description here

If we had the time for manual adjustments we should however not use automatic processing for better results.

  • Many thanks. I will play around with the GIMP functionality and see what I can manage. Fortunately, the images are all taken on the same instrument (an Aperio slide scanner) so at least that variable is under control. – Richard Levenson Jun 17 '13 at 4:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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