skip to Main Content

I currently have a large range of colored pictures which all differ in brightness. However since this is for a research project, it is necessary the brightness levels in these pictures are standardized. Therefore I was wondering if there is a way to solve this issue?

I was wondering if this was perhaps possible with Photoshop or ImageMagick, though I am clueless on how to batch process a series of images on both since I just started using these. I am also a complete beginner when it comes to ImageMagick.

Thank you in advance!

2

Answers


  1. This can be done in Imagemagick by matching one image to another using a script.

    You would select one good image as the standard and then match all the others one at a time to the standard one.

    If on Linux or Mac OSX, see http://www.fmwconcepts.com/imagemagick/matchimage/index.php

    If on Windows, see http://im.snibgo.com/setmean.htm

    One or both scripts allow you to replace the standard image with just its channel means and standard deviations. But there is less work by simply using the standard image.

    Alternately, use scripts by the same authors that match histograms.

    Login or Signup to reply.
  2. Fred’s answers are doubtless more sophisticated, but it may suffice to do simply what you asked, which was to standardise the brightness. You could do that in ImageMagick by converting to Lab colourspace and normalising just the Lightness channel before converting back to sRGB. That should give you something we could call "normalised brightness"

    magick input.jpg -colorspace Lab -channel 0 -normalize -colorspace sRGB result.jpg
    

    enter image description here enter image description here

    Photo by Henry Be on Unsplash


    enter image description here

    enter image description here

    Photo by Gilles Lambert on Unsplash


    As I said, this method is coarser than Fred’s and may introduce colour and contrast changes on some images – suck it and see. Try it on plenty of different input images before doing too much further work based on this approach.

    Note that you can "ring the changes" and try replacing -normalize in the above command with -auto-gamma, or with -auto-level or with -equalize and see if any are a closer match to your needs.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search