Page 1 of 1

Best automatic levels and color correction (preserving human flesh colors)

Posted: 2018-05-28T01:13:42-07:00
by Elapido
I work with hundreds of photos, all of them human portraits and human bodies. Many of them have wrong levels (poor contrast). If you take a look a their histograms you can see that the left end (shadows) is not filled, or maybe the right end (lights) or even both ends. I have made a script with Autohotkey and using Imagemagick to spot those images that do not fill the histogram correctly. It works well. However, I've been trying to automate also the level and color correction of these images and the results are not always good. I've tried with Imagemagick commands, and also with Photoshop automations (auto tone), and also with ACDSee automatic corrections. In most cases, the levels are correctly adjusted. However, the problem is that sometimes the adjustment of shadows adds too much saturation to the images, so the flesh becomes too red. Therefore, I have to manually reduce saturation with Photoshop and sometimes move the tone slider a bit to the right (to add a little of green to the color of the flesh, which sometimes is too pink). I wonder if there are some commands, set of commands or scripts made with Imagemagick to work specifically with portraits, in the sense that the color of the flesh is prioritized, avoiding so some horrible results such as people looking reddish or greenish. Is this possible or should I have to wait for some kind of artificial intelligence program that is able to correct levels and colors like I would do in multiple steps and depending on the problems of each photo?

Re: Best automatic levels and color correction (preserving human flesh colors)

Posted: 2018-05-28T05:22:37-07:00
by snibgo
Increasing contrast by spreading levels in red, green and blue channels will have a side-effect of increasing saturation and changing hue. This is especially true when the spreading occurs in the shadows rather than the highlights.

To avoid this, you can convert the image to another colorspace that has a "lightness" channel, then spread the levels in that channel only, then convert back. So the tones are spread, but chromaticity is unchanged. For example (Windows syntax):

Code: Select all

magick ^
  in.png ^
  -colorspace Lab ^
  -channel 0 ^
  -auto-level ^
  +channel ^
  -colorspace sRGB ^
  out.png
If your main concern is with flesh tones, you may find that YCbCr gives better results than Lab.

Re: Best automatic levels and color correction (preserving human flesh colors)

Posted: 2018-05-29T03:09:29-07:00
by Elapido
Excellent! I have tried with some photos and it's true that the colors are preserved. Tonight I will pick some of the photos that had very poor results with Photoshop's autotone and see what happens. Thank you.