change shadows/highlights color in image

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
eraemaajaervi
Posts: 2
Joined: 2012-01-27T12:26:01-07:00
Authentication code: 8675308

change shadows/highlights color in image

Post by eraemaajaervi »

hi,

i'm trying to achieve the effect that is described in this video:http://phlearn.com/color-toning-with-re ... episode110 (interesting part start at 8:10)

basically it changes the tone of the image by replacing the color of shadows with a given color and the highlights with another given color.
in photoshop you get this effect using the "Blend If" blending mode, which blends the color in your shadows (or lights).

is there a script out there, that does something similar?
or does someone know an according algorithm?

thanks
.eraemaajaervi
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: change shadows/highlights color in image

Post by fmw42 »

If on unix/mac or windows w/ cygwin, see my script colorbalance at the link below. It does not do exactly what you want, though something similar could be developed. But my basic concept for separating midtones, highlights and shadows is there. One would have to write a new script using that concept, but rather than adjusting channels values, one would use a mask from the selected range and composite with whatever color you need for each region.
eraemaajaervi
Posts: 2
Joined: 2012-01-27T12:26:01-07:00
Authentication code: 8675308

Re: change shadows/highlights color in image

Post by eraemaajaervi »

thanks for the reply. i'll play around with your colorbalance script
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: change shadows/highlights color in image

Post by fmw42 »

The real issue here is how to get the highlight and shadow "masks" that look reasonable. Using my default values in the scripts mentioned above does not produce reasonable results. So one has to use trial an error to keep adjusting to get reasonable looking masks. This is not as easy in IM as in PS as it does not give you the real-time visual results that you get in Photoshop using sliders. I think a different approach is needed and I would have to play around some with PS to see what they are actually doing.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: change shadows/highlights color in image

Post by fmw42 »

After reviewing the tutorial and testing in Photoshop, I think I have a handle on what they are doing. So I am working on a test script. I will report back later.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: change shadows/highlights color in image

Post by fmw42 »

I have just uploaded a new script, colortoning, to attempt to reproduce what was done in the tutorial link that used Photoshop. See script at the link below.
Post Reply