I have a collection of colored/black-white images and most of them have different levels of brightness and saturation.
How can I normalize those images to make them all at the same "**scale**"?
In my case, some of the images might also have a huge amount of white pixels as they are the scans of some old photos.
Thanks
It's hard to suggest anything very concrete without seeing your images, but one idea might be to move to a colourspace that is based on Brightness and Saturation and then to do an auto-gamma correction on the two channels of interest.
It could make a horrible mess so please make backup of your images first!
So, I am suggesting something along the lines of:
convert Original.jpg -colorspace HSL -channel B -auto-gamma -colorspace sRGB BrightnessNormalised.jpg
where I move to "Hue, Saturation and Lightness" colourspace, select the Lightness
channel (it is the 3rd one so it is B
out of RG&B
) and do an auto-gamma of the Lightness
and save back as a brightness-corrected, sRGB JPEG.
Likewise, to normalise the saturation, you could do:
convert Original.jpg -colorspace HSL -channel G -auto-gamma -colorspace sRGB SaturationNormalised.jpg
And you could do both at once, by using -channel GB
like this:
convert Original.jpg -colorspace HSL -channel GB -auto-gamma -colorspace sRGB Normalised.jpg
Normalising the saturation is probably not a good idea for greyscale images but do some tests.
Normalising the brightness of images is not really a good idea if you have moody, low-key photographs or airy, light, high-key photographs. Hang onto that backup - just make a ZIP/compressed tar-ball and keep it around.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.