Gimp: Invert and merge (to remove color cast)

@st.raw Usually, in my case, I tend to focus on the possibilities when giving advice because everyone’s goal is different. Glad someone is jogging your memories. Appreciate the context, probably would have been useful earlier in the thread… Even more info would be nice, such as the age of the film and the location of the shot.

Hi, I am trying to remove a strong color cast in the attached image. It was shot at an event where they had strong blue and red spotlights. As one can see in the image, a strong blue spotlight has ruined the entire image-making is entirely blueish. How can I achieve a neutral tone in this image and remove the strong blue color cast as well?

I tried a lot of online solutions such as How to Correct White Balance Color Cast Using GIMP, https://www.youtube.com/watch?v=1ZIGDx4Bg-k and pixovert’s youtube video as well.

Welcome @Milan_Pandya,

Because it has a severe color cast, the first usual methods will not work at first. Your image has the most information in the blue channel. So you can mix this “blue” information in the green en red channel. In the blue channel you can reduce the blue.

In this case you can first use a “Channel Mixer”. For example in GIMP: Colours>Components>Channel Mixer.

In G’MIC you can use: Colors>RGB Tone (but this is an advanced channel mixer, a bit difficult)

Or you can edit this in RawTherapee. It has a very nice channel mixer.

Here GIMP 2.8:


With this result:
example_mixer
This is a very quick edit. The preview is small in GIMP 2.8, so this first result can be better after playing.

After the “channel mixer”, you can use other color correcting methods, like you mentioned above.

One thing is important to know: with such a severe color cast, you can not get a perfect result.

Edit: Now with G’MIC>Colors>RGB Tone and G’MIC>Colors>Curves and GIMP Wavelet Denoise (CbCr):

4 Likes


I’ve used a lot of curves but this reveals noise and digital artifacts.

3 Likes

With my edits the blue disappeared totally. You did keep some blue.I like that.

1 Like

Thank you age and iarga. Iarga, your steps were really helpful and screenshots made it easier to follow. Age, thank you for demonstrating curves manipulation.

My G’MIC work flow. I am really bad with colours, so maybe my result is ugly. But my steps should be okay for someone with better eyes and judgement. I will say it in words that everyone can understand.

1 Find average colour of entire photo and make a copy (layer) filled with that colour but inverted.

2 Shift the RGB channels as desired. (You may want to do step #3 for preview purposes.)

3 Merge (down or to new layer) by multiplying original with copy (layer).

4 Cut (clip) highlights. I clipped and stretched the image but you should probably change the exposure. Do this to bring the skin and faces into the lower mid tones and remove contrast on the screen, which shouldn’t be the focus on the photo. It’s distracting!

5 Chroma adjustment. This will further deemphaize the screen and tame the colourful cardboard or fabric that is covering the edge of the stage, which is very distracting!

For this, decompose the image into L*C*ho and then do the following on the C channel: use the curve tool to clip the top highlights and pull down the mid tones and shadows. (You may not need to de- and re-compose if your editor has a tool that can handle the C channel with curves.)

6 Make grey scale copy (layer), give it a mask of itself and use that to blend with the colour layer below by opacity.

7 Take other steps for taste. I just sharpened the image a bit and resized it for the post.

Bonus my G’MIC command. This is a one-liner. It could probably be optimized and generalized into a new command if there is a demand for that.
^^ is an escaped ^
afre_* and *_ commands are my public and private commands, respectively.

gmic cc.jpg r,g,b={[${-average_colors}]^^-1} s c *[0] $r *[1] {$g*.8} *[2] {$b*.65} a c c 0,50% chroma_ .5,.8 +afre_y50 1 to_rgb. n 0,255 +l. n 0,1 f gauss(i-1) n 0,.4 endl blend_fade[0,1] . k[0] afre_sharpenfft 10,1 r2dx 1800,2 n 0,255 round o corrected-afre.jpg

1 Like

Inspired by the color balance module in darktable it’s possible to neutralize a color using the gimp in the same way.

Neutralize color with multiplication (slope)

1)open your image

2)duplicate the layer and find the average color with the pixelise blur tool

3)duplicate the average color layer, set the top layer to divide

4)set the middle layer to multiply

5)desaturate the middle layer (using relative luminance,luma or lightness (hsl)


That’s all.
The equivalent in the curve tool is this

Simple but very effective :muscle:t2:

Basically the formula is:

white balanced image= image * ( desaturate_average_color / average_color)

Some other funny things that is possible to do with the gimp blending layer modes are:

Neutralize dark colors with addition and subtract (offset)
Auto-exposure
Reinhard tone mapping
Color preserving rgb curves or rgb levels
Enhance saturation

3 Likes

Wysyłanie: beach01_alloff-GIMP.jpg

My monochrome version GIMP hahaha

1 Like

@age I ended up adding a new filter to g’mic that does the pixelate part, but with more color space thanks to your tutorial. Ideally, I would have add a new filter to Krita instead, but I still have the guided selection progress work on my end which I should really get to finishing this weekend.

Done on Krita + G’MIC.

Layer layout

image

The duplicated original image was applied with my gmic filter named Statistical Average.
Clone layer automatically clone the info from duplicated original image. The duplicated original layer could be in a group layer, and the clone layer could be the clone of the group layer for easier manipulation and more NDE.
The filter mask can be changed to desire.

1 Like

Totally not what I was looking for!!!

But aside that, it looks really cool. I really like it. Very skillful edit. I will give that a try.

The drama. :slight_smile: