RSS/Atom feed Twitter
Site is read-only, email is disabled

Selectable white-balance adjust (was: Automatic white balance)

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

12 of 13 messages available
Toggle history

Please log in to manage your subscriptions.

Automatic white balance Weber, Dr. Martin (Allianz ASIC) 26 Nov 15:22
  Automatic white balance Alexandre Prokoudine 26 Nov 15:42
   Automatic white balance Øyvind Kolås 27 Nov 01:37
  Automatic white balance Øyvind Kolås 27 Nov 01:36
   Automatic white balance Stephane Chauveau 27 Nov 20:04
    Automatic white balance Jean-Luc Coulon (f5ibh) 28 Nov 09:13
     Automatic white balance Sven Neumann 28 Nov 09:24
     Selectable white-balance adjust (was: Automatic white balance) Toby Speight 03 Dec 16:55
474C6966.20707@chauveau-cen... 07 Oct 20:26
  Automatic white balance Øyvind Kolås 27 Nov 20:57
   Automatic white balance Stephane Chauveau 27 Nov 22:04
    Automatic white balance Sven Neumann 28 Nov 08:25
     Automatic white balance Stephane Chauveau 29 Nov 00:15
Weber, Dr. Martin (Allianz ASIC)
2007-11-26 15:22:35 UTC (about 17 years ago)

Automatic white balance

I think the automatic white balance of many programs as well as of GIMP is not always leading to optimal results. So I want to deleope a new better algorithm for GIMP. To be able to I would like to get as many information as possible about the commenly used ones. So if you know an automatic white balance algorithm please tell me.
Greetings
Martin

Alexandre Prokoudine
2007-11-26 15:42:29 UTC (about 17 years ago)

Automatic white balance

On Nov 26, 2007 5:22 PM, Weber, Dr. Martin (Allianz ASIC) wrote:

I think the automatic white balance of many programs as well as of GIMP is not always leading to optimal results. So I want to deleope a new better algorithm for GIMP. To be able to I would like to get as many information as possible about the commenly used ones. So if you know an automatic white balance algorithm please tell me.

Relevant part of DCRaw/UFRaw source code?

Alexandre

Øyvind Kolås
2007-11-27 01:36:38 UTC (about 17 years ago)

Automatic white balance

On Nov 26, 2007 2:22 PM, Weber, Dr. Martin (Allianz ASIC) wrote:

I think the automatic white balance of many programs as well as of GIMP is not always leading to optimal results. So I want to deleope a new better algorithm for GIMP. To be able to I would like to get as many information as possible about the commenly used ones. So if you know an automatic white balance algorithm please tell me.

You could start out by studying the following paper, as well as it's references:

http://www.ivl.disco.unimib.it/papers2003/WB%20Combining%20%20EI%206502-12.pdf

/Øyvind K.

Øyvind Kolås
2007-11-27 01:37:27 UTC (about 17 years ago)

Automatic white balance

On Nov 26, 2007 2:42 PM, Alexandre Prokoudine wrote:

On Nov 26, 2007 5:22 PM, Weber, Dr. Martin (Allianz ASIC) wrote:

I think the automatic white balance of many programs as well as of GIMP is not always leading to optimal results. So I want to deleope a new better algorithm for GIMP. To be able to I would like to get as many information as possible about the commenly used ones. So if you know an automatic white balance algorithm please tell me.

Relevant part of DCRaw/UFRaw source code?

Alexandre _______________________________________________ Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer

Stephane Chauveau
2007-11-27 20:04:12 UTC (about 17 years ago)

Automatic white balance

Øyvind Kolås wrote:

On Nov 26, 2007 2:22 PM, Weber, Dr. Martin (Allianz ASIC) wrote:

I think the automatic white balance of many programs as well as of GIMP is not always leading to optimal results. So I want to deleope a new better algorithm for GIMP. To be able to I would like to get as many information as possible about the commenly used ones. So if you know an automatic white balance algorithm please tell me.

You could start out by studying the following paper, as well as it's references:

http://www.ivl.disco.unimib.it/papers2003/WB%20Combining%20%20EI%206502-12.pdf

/Øyvind K.

Nice article. The following Wikipedia pages does not describe so many methods but are probably easier to start with:

http://en.wikipedia.org/wiki/White_balance http://en.wikipedia.org/wiki/Color_temperature

The following article is even less technical but is also a nice read and it explains the most common issues with automatic WB.

http://www.cambridgeincolour.com/tutorials/white-balance.htm

Anyways, a plug-in providing several WB methods would be cool but, in most cases, I believe that it would be even better to extend the Color Balance tool with the ability to manually pick the grey point in the image. The easiest way to implement that feature could be to add a 'Set White Point' button to the Color Picker tool.

Øyvind Kolås
2007-11-27 20:57:46 UTC (about 17 years ago)

Automatic white balance

On Nov 27, 2007 7:00 PM, Stephane Chauveau wrote:

Øyvind Kolås wrote:

You could start out by studying the following paper, as well as it's references: http://www.ivl.disco.unimib.it/papers2003/WB%20Combining%20%20EI%206502-12.pdf

/Øyvind K.

Nice article. The following Wikipedia pages does not describe so many methods but are probably easier to start with:

http://en.wikipedia.org/wiki/White_balance http://en.wikipedia.org/wiki/Color_temperature

The following article is even less technical but is also a nice read and it explains the most common issues with automatic WB.

http://www.cambridgeincolour.com/tutorials/white-balance.htm

Anyways, a plug-in providing several WB methods would be cool but, in most cases, I believe that it would be even better to extend the Color Balance tool with the ability to manually pick the grey point in the image. The easiest way to implement that feature could be to add a 'Set White Point' button to the Color Picker tool.

This functionality exists in the levels tool already.

Personally I'd prefer a gui similar to:

http://pippin.gimp.org/plug-ins/color_correct/

for a combined levels (on luminance) and white point/gray point/black point offset. Since I don't find it entirely natural to modify the white point using levels.

/Øyvind K. (Doing full quote and replying to the list since the message I reply to didn't seem
to be sent to the list.)

Stephane Chauveau
2007-11-27 22:04:53 UTC (about 17 years ago)

Automatic white balance

Øyvind Kolås wrote:

On Nov 27, 2007 7:00 PM, Stephane Chauveau wrote:

Øyvind Kolås wrote:

You could start out by studying the following paper, as well as it's references: http://www.ivl.disco.unimib.it/papers2003/WB%20Combining%20%20EI%206502-12.pdf

/Øyvind K.

Nice article. The following Wikipedia pages does not describe so many methods but are probably easier to start with:

http://en.wikipedia.org/wiki/White_balance http://en.wikipedia.org/wiki/Color_temperature

The following article is even less technical but is also a nice read and it explains the most common issues with automatic WB.

http://www.cambridgeincolour.com/tutorials/white-balance.htm

Anyways, a plug-in providing several WB methods would be cool but, in most cases, I believe that it would be even better to extend the Color Balance tool with the ability to manually pick the grey point in the image. The easiest way to implement that feature could be to add a 'Set White Point' button to the Color Picker tool.

This functionality exists in the levels tool already.

Nice! I never noticed that the grey point picker in the level tool could be used to adjust the WB. It is unfortunately limited to the mid-tones.

The behavior I have in mind is quite different and is more like the one found in most cameras and described in the paper you mentionned (the Von Kries hypothesis): figure out a grey point to compute a set of 3 coefficients (for red,green and blue) and multiply each channel by its respective coefficient (with clipping). See for example how WB can be done in UFraw by selecting a grey area with the mouse.

Personally I'd prefer a gui similar to:

http://pippin.gimp.org/plug-ins/color_correct/

for a combined levels (on luminance) and white point/gray point/black point offset. Since I don't find it entirely natural to modify the white point using levels.

Me neither. The grey/white point in white balance (the illuminant tint) and the grey point in levels (the average brightness) are very different concepts.

/Øyvind K. (Doing full quote and replying to the list since the message I reply to didn't seem
to be sent to the list.)

Sven Neumann
2007-11-28 08:25:45 UTC (almost 17 years ago)

Automatic white balance

Hi,

On Tue, 2007-11-27 at 22:04 +0100, Stephane Chauveau wrote:

Nice! I never noticed that the grey point picker in the level tool could be used to adjust the WB. It is unfortunately limited to the mid-tones.

How is it limited to the mid-tones?

Sven

Jean-Luc Coulon (f5ibh)
2007-11-28 09:13:39 UTC (almost 17 years ago)

Automatic white balance

Le 27.11.2007 20:04:12, Stephane Chauveau a écrit :

Øyvind Kolås wrote:

On Nov 26, 2007 2:22 PM, Weber, Dr. Martin (Allianz ASIC) wrote:

Anyways, a plug-in providing several WB methods would be cool but, in most cases, I believe that it would be even better to extend the Color Balance tool with the ability to manually pick the grey point in the image. The easiest way to implement that feature could be to add a 'Set

White Point' button to the Color Picker tool.

A nice feature in this case would be to be able to get the white point in an OTHER picture.

With digital photography, I use often raw pictures. At the beginning of the shot, I get a picture of a grey/white card which will be the white reference for all the following pictures. If the light conditions change, I get an other picture of the grey chart and so I never mind of the camara white balance, all the wotk is done in post-processing.

So it would be nice to be able to open a white reference picture and pick reference from this picture an apply it to the other shots.

Regards

Jean-Luc

Sven Neumann
2007-11-28 09:24:17 UTC (almost 17 years ago)

Automatic white balance

Hi,

On Wed, 2007-11-28 at 09:13 +0100, Jean-Luc Coulon (f5ibh) wrote:

So it would be nice to be able to open a white reference picture and pick reference from this picture an apply it to the other shots.

You can easily do that. Just do the color correction using the Levels tool on one image. Then save the Levels file and apply it to the other images. If you Shift-click the Save/Load buttons in the Levels tool dialog, you do not even need to enter a filename. Of course this could certainly be streamlined further.

Sven

Stephane Chauveau
2007-11-29 00:15:08 UTC (almost 17 years ago)

Automatic white balance

Sven Neumann wrote:

Hi,

On Tue, 2007-11-27 at 22:04 +0100, Stephane Chauveau wrote:

Nice! I never noticed that the grey point picker in the level tool could be used to adjust the WB. It is unfortunately limited to the mid-tones.

How is it limited to the mid-tones?

Sven

The black point picker is of course totally useless for adjusting the white balance.

The white point picker can be very useful for white balance but, since it also set the white point, it can only be used you have a true white point in you image. By that, I mean a point that is both neutral-grey and of maximal brightness. This is usually not the case.

So was it left is the 'middle-point' picker. This one sets the middle-point of the RED, GREEN & BLUE levels but without affecting the 'right-point' of those levels. In practice that means that the white balance of the current 'white point' is absolutely not affected by that picker. More generally, the more you are the highlights, the less you are affected by the 'middle-picker'. That was I mean by 'limited to the mid-tones' though I should have written 'mid-tones and shadows' since the 'middle-point' picker also affect the shadows (but in practice they are less interesting).

If you are not convinced (or just don't understand me) then think about that: you cannot change a true white point (255,255,255) using the middle-point picker.

However, after playing a bit with the middle-point picker, I came to the conclusion that the results are usually quite good. This is because, in Gimp, the WB is usually applied on an image that was already adjusted (AWB and exposure in the camera, ...) so the WB coefficients tend to be small (-15% to 25% on each channel), most of the image is already in the mid-tones or shadows and the parts that are in the highlight are often already white (typically the clouds). Not having to care about clipping the highlights is also nice.

The situation in a tool like UFraw is quite different: The WB is usually the first transformation applied to the raw data. The WB coefficients can be huge (-50% to +100% on each channel) and are followed by some complex adjustments (ICC profile, exposure, gamma, highlight clipping and recovery, ...).

Toby Speight
2007-12-03 16:55:10 UTC (almost 17 years ago)

Selectable white-balance adjust (was: Automatic white balance)

0> In article ,
0> Jean-Luc Coulon ("Jean-Luc") wrote:

Jean-Luc> A nice feature in this case would be to be able to get the Jean-Luc> white point in an OTHER picture. Jean-Luc>
Jean-Luc> With digital photography, I use often raw pictures. At the Jean-Luc> beginning of the shot, I get a picture of a grey/white card Jean-Luc> which will be the white reference for all the following Jean-Luc> pictures. If the light conditions change, I get an other Jean-Luc> picture of the grey chart and so I never mind of the camara Jean-Luc> white balance, all the wotk is done in post-processing. Jean-Luc>
Jean-Luc> So it would be nice to be able to open a white reference Jean-Luc> picture and pick reference from this picture an apply it to Jean-Luc> the other shots.

I use a script that does this. It's very simple and doesn't deal with colour management, or extreme colours. It is, however, simple to use - just select the colour that should be white (e.g. with the picker), and then run the plug-in. It's particularly handy for your case, because as long as you have the same selected foreground colour, you can run the script on many images. Here's the script-fu:

---- cut here --- ; whitebalance.scm

; adjust image white balance based on current foreground color.

; Author: Toby Speight ; Licence terms: GNU GPL v2 or later

(script-fu-register "script-fu-whitebalance"
"/Colors/_White Balance"
"Adjust the image colors so that the current foreground color becomes completely desaturated. In other words, if you have selected a color from the image that should be white, then this will correct any color cast." "Toby Speight "
"Toby Speight"
"2005-10-20"
"RGB*"
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0)

(define (script-fu-whitebalance img drawable) (let* ((color (car (gimp-context-get-foreground))) (red (car color))
(blue (cadr color))
(green (caddr color))
(mean (/ (+ red blue green) 3.0))) ;; TODO: check for divide-by-zero (plug-in-colors-channel-mixer
1 img drawable 0
(/ mean red) 0.0 0.0
0.0 (/ mean blue) 0.0
0.0 0.0 (/ mean green)) (gimp-displays-flush)))