It is currently Thu Jun 04, 2026 6:06 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: A little script I wrote, don't worry, be happy: color images
PostPosted: Thu Jan 08, 2026 10:04 am  (#1) 
Offline
GimpChat Member
User avatar

Joined: Jan 01, 2026
Posts: 434
About Color Images

There are only two forms of color light in this world: additive and subtractive. In the additive world, a
light source is needed to create colors. When the primary colors (red, green, and blue) are combined,
they will create a white light, as shown in 3.0.

Attachment:
RGB_illumination.jpg
RGB_illumination.jpg [ 22.64 KiB | Viewed 2432 times ]

Additive color refers to the practice of combining non-reflected colored light. If
we take the visible light spectrum and divided into thirds, we would see that
red, green, and blue are the predominant colors. When these three colors are
added together in equal amounts it will make white light. In the same way, if
you add equal amounts of only two of these three colors you can create
secondary colors of cyan, yellow and magenta. By using different amounts of
each colored and strength, you can create all kinds of derivative colors.
Television and computer monitor are good example of this theory in action.
By uses thousands of red, green and blue pixels in combination with different
value of light, they can produce many different colors, from white to black and
all those in between. In the subtractive world, color is determined by the absorption
of light. When the secondary colors (cyan, magenta, and yellow) are combined, they
will create black-brown, as shown in 3.1.

Attachment:
example31.jpg
example31.jpg [ 15.05 KiB | Viewed 2432 times ]

Like a common ink jet printer, shows us a good illustration of this subtractive
at work. In creating inks for printing, impurities in the pigments result in muddy black-brown
when you combine cyan, magenta, and yellow together. To achieve rich shadows and pure
blacks, black was added to the printing process to be able to create those colors. By combing
additive primary colors togethers you will produce the subtractive primary colors, and if you
combine the subtractive primary colors together, you will create the additive primary colors.

Therefore, understanding these principles can be very useful when identifying and correcting color
problems in your images. A good example of using these principles, would be, trying to remove a color
cast. Let’s say you have an image that is too blue or has a bluish tint to it, because the flash wasn’t set
correctly. You would have two ways to approach this problem: one, you could either increase the
other 2 primary color to equal the overpowering blue tint, or decrease the blue to match the other 2
primary colors to correct the colorcast. In both cases, you will be able to remove the color cast
from the image. The biggest problem is finding that right settings to fix this problem. So, we could say
this, color casts are created because there is an imbalanced of 1 or 3 of the 3-primary color of light:
all three colors of light must have the same amount of volume to be able to produce white as
shown example 3.0.

_________________
Image
Gimp 3.2.4 with Nik Collection and G'mic-QT
Windows 11 Pro with 32 Gigs of RAM
Intel(R) Core(TM) Ultra 7
Previous Paint Shop Pro User v9 - 2023


Last edited by TeaMouse on Thu Jan 22, 2026 3:49 pm, edited 1 time in total.

Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: A little script I wrote, don't worry, be happy: color images
PostPosted: Thu Jan 08, 2026 11:51 am  (#2) 
Offline
GimpChat Member
User avatar

Joined: Mar 01, 2014
Posts: 14006
Location: Spain, Aragón
Thank you so much for your tutorials. You make it more understandable. :) :tyspin

_________________
Image

Gimp 2.10.30(samj) portable _ OS Windows 10 Home_ 64bits
Don’t be afraid to start over. It’s a new chance to rebuild what you want.


Top
 Post subject: Re: A little script I wrote, don't worry, be happy: color images
PostPosted: Thu Jan 08, 2026 12:02 pm  (#3) 
Offline
GimpChat Member
User avatar

Joined: Jan 01, 2026
Posts: 434
Colored faded Images

In our next example 4.0, we have a photo that could have been a black and white
at one time, but has just faded over the years.

Attachment:
example40.jpg
example40.jpg [ 17.58 KiB | Viewed 2415 times ]

There are a couple different ways to return this back into a good black and
white image. For this illustration I’m going to show you how to use the levels option; but this
time where are going to adjust each of the 3-color channel to make each one equal to the other two, thus
restoring it back to a nice black and white looking image again. And here is what I did.
First, I change the color channel from Values to the red channel to work with, and I adjust the
gamma sliders according to the points indicated by the ranges of the red channel in the photo,
not adjusting the midtones range (Clamp Input). From the main tool bar of Gimp and go to.

Colors > Levels
Looking at the next image, you can see the settings I used. I want all 3 color channels to
have the same amount of color range and level range to restore the black and white image.

Attachment:
level-adjustment.jpg
level-adjustment.jpg [ 224.86 KiB | Viewed 2318 times ]


Once I made the changes I wanted, I Then changed the color channel to the green
and repeated the same steps, I want to slide my lightest point and darkest point to match my color
range for that channel. Once I made those changes I Then change the color channel to Blue and
repeat the same steps once more, by sliding my lightest point and darkest point to match my color
range for that channel. Then click OK

Attachment:
example40.jpg
example40.jpg [ 25.3 KiB | Viewed 2415 times ]


Now as you can see there is a slight tint to the image left from the Levels corrections,
This can vary from program-to-program functions of how they created the levels tool. In Gimp they
created a way to remove this (FX) in the process. To fix this...

Go to Main Tool Bar >Layer > New from Visible
Then Layer> (Shift + Shift + D) Duplicate Layer
Chane the top layer blending mode to HSL Color with the Opacity at 50%
Next go to, Colors > Invert
And then right click your layers palette and Merge Visible Layers > OK.
And you're all done.

_________________
Image
Gimp 3.2.4 with Nik Collection and G'mic-QT
Windows 11 Pro with 32 Gigs of RAM
Intel(R) Core(TM) Ultra 7
Previous Paint Shop Pro User v9 - 2023


Last edited by TeaMouse on Sat Jan 10, 2026 10:47 am, edited 1 time in total.

Top
 Post subject: Re: A little script I wrote, don't worry, be happy: color images
PostPosted: Thu Jan 08, 2026 12:43 pm  (#4) 
Offline
GimpChat Member
User avatar

Joined: Jan 01, 2026
Posts: 434
Color Picker Tool is your friend

So, by now you should have a better understanding how the additive color light
source works, and how each color channel values treat that light; the red, green, and
blue. In the computer world we have values that ranging from 0 to 255 instead
of percentages. Therefore, if each primary color has a value of 0%, no colored light
source, meaning; it has 0 red in it, or 0 green in it or 0 blue, you would end up
with black, there’s no light source. So, this means that white light is made of the 3
primary colors (RGB) with a set value of 255 per channel. As shown in previous example 3.0
to produce the white light in the middle by using these 3 primary colors.

Option one to correct a color cast

A good way to determent values of a color cast is to use the Color Picker tool; a simple tool but very
powerful at that, it can collect the 3-color light values of any spot on an open image. By using the
Picker Tool, you can get the information you need to see and why it is not as white as you would like….

R:255, G:255, B:255, O:255 = 100% White

So now, if your image has a color cast for whatever reason(s), old image, poor scanning setting, a
camera setting or just faded. You can correct this in a few different ways in Gimp; one
method would be to see what the value of the 3 colors (RGB) channels are and how they relate to
each color channel. This way you can see what’s lacking in your image to make it possible to fix
the problem. In simple terms, which color channel(s) need to be adjusted and how.

Therefore, let’s say you took a sample reading of an area where the color cast is showing in your image,
a place that should appear to be white or very close of being white, and by doing so, this is what your
sample area revealed with the Color Picker Tool….

R:58, G:13, B:10

With this sample reading, in order to correct the color cast from your image,
you would subtract each color value from 255 to find the color value that is needed to
correct the overall white balance by correcting each of the RGB channels of light.

(Red Channel) 255 - 58 = 197
(Green Channel) 255 – 13 = 242
(Blue Channel) 255 – 10 = 245

To correct the color cast, you would create a new layer above your image and set
the blending mode to HSL Color (Legacy) with the opacity set at 50%, and fill it with that color….
R:197, G:242, B:245 = The opposite color of the Color Cast And then merge it down.

Note if your HSL Color (Legacy) layer is not set at 50% to restore the overall white
balance, then you have not found the correct color values for each color channel and must try again.

_________________
Image
Gimp 3.2.4 with Nik Collection and G'mic-QT
Windows 11 Pro with 32 Gigs of RAM
Intel(R) Core(TM) Ultra 7
Previous Paint Shop Pro User v9 - 2023


Top
 Post subject: Re: A little script I wrote, don't worry, be happy: color images
PostPosted: Thu Jan 08, 2026 2:39 pm  (#5) 
Offline
GimpChat Member
User avatar

Joined: Jan 01, 2026
Posts: 434
Option two to correct a color cast

Now there is a way to do the same thing as in option one, but in a
different way. This time there is no math calculations involved to find the
right color (the opposite one) needed to use, so to equal out each color channel (RGB).
Here we have a image with the camera setting was not set to the correct setting to take
a good picture. My bad!, So with example 5.2 here I will should how to fix it.

Attachment:
ColorCastKitty.jpg
ColorCastKitty.jpg [ 27.37 KiB | Viewed 2404 times ]


The first thing you need to do is,
Dulpicate (Shift + Crtl + D) the image in the layer palette
Then from the main tool bar go to > Colors > Invert
(to reverse the Image colors.)
Next using the Color Picker tool to change the foreground color, select an area from the
top layer, an area that should be white on background layer that is underneath the top
layer to properly fix the color cast. (Selected color should not be solid black).

Now Layer> New Layer >
Change the Blending mode to HSL COLOR, Opacity at 50%,
fill with foreground color and then click OK.
See next image for help. Where to select and what you layer palette should look like now.

Attachment:
palette-layer-01.jpg
palette-layer-01.jpg [ 132.87 KiB | Viewed 2404 times ]

Now for the Magic.
Delete the middle layer and select the top Layer
Goto > Layer > Merge Down


As I noted before, if your adjustment for the top layer is set at
50% and it don't fix the problem, you have not correctly selected the white
balance area and you are slightly off target. This doesn’t mean you can’t fix the white
balance with it. It’s just giving you clues about the sample color
you selected doesn’t make all 3-color channel equal in your image
and you'll have to try again.

In my example I used here, I selected my color sample under the
kitty nose and to the right, where the arrow is pointing in the example image,
not behind the kitty ear where it is washed out.


Attachment:
ColorCastKittyb.jpg
ColorCastKittyb.jpg [ 23.96 KiB | Viewed 2404 times ]

Now you're probably thinking, why go all through that to fix the image when
I have the Equalize Tool, which by the way can fix it with one click, what do you do when it
won't fix it. Then what. What do you do, how will you fix it, that's why you should learn how to do
this the old way and I'll show the reason for it in the follow example!

_________________
Image
Gimp 3.2.4 with Nik Collection and G'mic-QT
Windows 11 Pro with 32 Gigs of RAM
Intel(R) Core(TM) Ultra 7
Previous Paint Shop Pro User v9 - 2023


Last edited by TeaMouse on Thu Jan 08, 2026 5:31 pm, edited 4 times in total.

Top
 Post subject: Re: A little script I wrote, don't worry, be happy: color images
PostPosted: Thu Jan 08, 2026 3:55 pm  (#6) 
Offline
GimpChat Member
User avatar

Joined: Jan 01, 2026
Posts: 434
What to do when the Equalize Tool Doesn't Work

So here is the Problem Child Image

Attachment:
clouds.jpg
clouds.jpg [ 33.8 KiB | Viewed 2402 times ]

Looking at this image, the Equalize cannot fix it. Why, because it only knows
one way to process it, based on what it was programed to do. Like I said before, the Tool does a
good job on a lot images, but in this case it fails. But I will show you how it was done in the
early stages of photo editing. Here is Equalize version of it.

Attachment:
lady-with-clouds.jpg
lady-with-clouds.jpg [ 44.95 KiB | Viewed 2402 times ]

Looking at this image you can see that it focus on the white clouds and the rest is all
wacky looking, and that because it broke one of the rules I spoke about really, when using the Color Pick Tool.
Don't select the direct should to be white area but be very close to it. You'll have a better chance of getting it
right the first time. So here is my process.

1. Duplicate the image Layer
2. Invert the Color
3. Use the Color Picker Tool to get my color. (The X is my choice)

Attachment:
lady-with-clouds1.jpg
lady-with-clouds1.jpg [ 30.12 KiB | Viewed 2402 times ]

4. Created my new HSL Color layer and fill with my selected color at 50% opacity.
5. Delete the middle Layer and Merge down
6. Duplicated Layer change blending mode to screen.
7. Created a copy visible of image and pasted as my top layer
8. Change that layer blending mode to screen
9 Created Mask Layer - Black and painter the lady area with white in the mask.
10. Merge Down visibly
13. Last step Open the Hue-Chroma and made this changes. Hue -4, Chroma 4, Lightness 3.
All done with no big head acks.

_________________
Image
Gimp 3.2.4 with Nik Collection and G'mic-QT
Windows 11 Pro with 32 Gigs of RAM
Intel(R) Core(TM) Ultra 7
Previous Paint Shop Pro User v9 - 2023


Last edited by TeaMouse on Thu Jan 08, 2026 6:06 pm, edited 5 times in total.

Top
 Post subject: Re: A little script I wrote, don't worry, be happy: color images
PostPosted: Thu Jan 08, 2026 4:24 pm  (#7) 
Offline
GimpChat Member
User avatar

Joined: Jan 01, 2026
Posts: 434
Now after a few touchups and tweaks, this is what I have.
This image was probably a polaroid photo

Attachment:
lady-with-clouds3.jpg
lady-with-clouds3.jpg [ 31.22 KiB | Viewed 2399 times ]

Now about this process, you should note that this will only correct one
color cast in an image. If you have two different color cast, this will not remove both
at the same time. Which means you will have to do some serially coloring toning.
What creates a two-colored cast is because of the image is faded from time, and may also
have been taken with incorrect camera setting.

Hope this helps!

_________________
Image
Gimp 3.2.4 with Nik Collection and G'mic-QT
Windows 11 Pro with 32 Gigs of RAM
Intel(R) Core(TM) Ultra 7
Previous Paint Shop Pro User v9 - 2023


Top
 Post subject: Re: A little script I wrote, don't worry, be happy: color images
PostPosted: Fri Jan 09, 2026 7:47 am  (#8) 
Offline
GimpChat Member

Joined: Jun 15, 2025
Posts: 18
TeaMouse wrote:
About Color Images

There are only two forms of color in this world: additive and subtractive.


Allow me to correct you on two common misunderstandings :

"Additive" and "subtractive" refer to color mixing, not color.

And there is at least one other way to mix color: partitive. Found everywhere in the real world, and in fine arts. It happens when different colors are adjacent, but the eye is unable to separate these. This can be experimented with very small adjacent colored surface, or with different colors on a very fast rotating disk.
This is the reason why mixing red and green pigments does not result in pure black: pigment mixing has characteristics of both subtractive and partitive mixing.


Top
 Post subject: Re: A little script I wrote, don't worry, be happy: color images
PostPosted: Fri Jan 09, 2026 7:55 pm  (#9) 
Offline
Global Moderator
User avatar

Joined: Apr 01, 2012
Posts: 8358
Location: On the other side of your screen
Auto input levels often helps with colour casting as well. With all colours at once.

_________________
Image
Free Fun Photo Editing & resources
Poems from the Lord
Gimp Newby
Gimp version 3.2.0 and GMIC-Qt 3.7.5 OS :- Windows 10 Home 64


Top
 Post subject: Re: A little script I wrote, don't worry, be happy: color images
PostPosted: Sat Jan 10, 2026 10:56 am  (#10) 
Offline
GimpChat Member
User avatar

Joined: Jan 01, 2026
Posts: 434
Scallact wrote:
TeaMouse wrote:
About Color Images

There are only two forms of color in this world: additive and subtractive.


Allow me to correct you on two common misunderstandings :

"Additive" and "subtractive" refer to color mixing, not color.

And there is at least one other way to mix color: partitive. Found everywhere in the real world, and in fine arts. It happens when different colors are adjacent, but the eye is unable to separate these. This can be experimented with very small adjacent colored surface, or with different colors on a very fast rotating disk.
This is the reason why mixing red and green pigments does not result in pure black: pigment mixing has characteristics of both subtractive and partitive mixing.


I would like to know more about this, is there any good links about this. With images for learning Example.

_________________
Image
Gimp 3.2.4 with Nik Collection and G'mic-QT
Windows 11 Pro with 32 Gigs of RAM
Intel(R) Core(TM) Ultra 7
Previous Paint Shop Pro User v9 - 2023


Top
 Post subject: Re: A little script I wrote, don't worry, be happy: color images
PostPosted: Sat Jan 10, 2026 6:53 pm  (#11) 
Offline
GimpChat Member

Joined: Jun 15, 2025
Posts: 18
TeaMouse wrote:
Scallact wrote:
TeaMouse wrote:
About Color Images

There are only two forms of color in this world: additive and subtractive.


Allow me to correct you on two common misunderstandings :

"Additive" and "subtractive" refer to color mixing, not color.

And there is at least one other way to mix color: partitive. Found everywhere in the real world, and in fine arts. It happens when different colors are adjacent, but the eye is unable to separate these. This can be experimented with very small adjacent colored surface, or with different colors on a very fast rotating disk.
This is the reason why mixing red and green pigments does not result in pure black: pigment mixing has characteristics of both subtractive and partitive mixing.


I would like to know more about this, is there any good links about this. With images for learning Example.


Here's a website with nice explanations, about pigment mixing and the mixing type I'm talking about:
http://www.huevaluechroma.com/061.php
http://www.huevaluechroma.com/044.php

Please note, they call it "additive averaging", I've never seen this terminology but it's the same concept. I use "partitive". The term "optical mixing" is also used sometimes.

Here they use "partitive" as well : https://leatriceeiseman.com/what-are-th ... or-mixing/

The knowledge around color is weird. The good accessible documentation is sparse. On one side you have scientific papers, with a clear but specialized understanding of their subject, and on the other side a myriad of books and websites for artists that repeat the same bs since centuries, sometimes half truths, sometimes plainly wrong.


Top
 Post subject: Re: A little script I wrote, don't worry, be happy: color images
PostPosted: Fri Jan 16, 2026 9:48 pm  (#12) 
Offline
Global Moderator
User avatar

Joined: Apr 01, 2012
Posts: 8358
Location: On the other side of your screen
Still have the blue color cast kitty on my desktop and thought about another way it could be done and it looks good - I know I tried it before but the face had a yellowy colour in it
Image
What I did was
1. Open the color cast photo
2. Color pick the cat's fur making the colour pick to the foreground color
3. Open another layer as the foreground colour
4. Change the layer mode to 'color erase'
5. Add another white layer and send to the bottom of the stack

_________________
Image
Free Fun Photo Editing & resources
Poems from the Lord
Gimp Newby
Gimp version 3.2.0 and GMIC-Qt 3.7.5 OS :- Windows 10 Home 64


Top
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group