Gimp-Forum.net

Full Version: Script-fu How Write Colors-Auto-White Balance
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have not found a way to write Colors-Auto-White Balance within Script-fu. Please advise how to do this.
Why do you need to write it since it is already written? Or you need to reproduce it? As far as I can tell the core is (gimp-drawable-color-balance drawable transfer-mode preserve-lum cyan-red magenta-green yellow-blue) with some heuristics (possibly using (gimp-drawable-histogram drawable channel start-range end-range) on each RGB channel) to determine how to change the color balance.
(12-02-2022, 06:16 PM)Ofnuts Wrote: [ -> ]Why do you need to write it since it is already written? Or you need to reproduce it? As far as I can tell the core is (gimp-drawable-color-balance drawable transfer-mode preserve-lum cyan-red magenta-green yellow-blue) with some heuristics (possibly using  (gimp-drawable-histogram drawable channel start-range end-range) on each RGB channel) to determine how to change the color balance.

Much thanks for sharing your knowledge.

I was needing to process batches of photos. The GIMP interactive is too slow.

The Colors-Auto-White Balance is not understood by myself. You have an understanding of what Auto-White Balance in detail is doing, which I don't possess.

If convinent please breakdown your script and explain its parts.
It is difficult for Gimp new-comers to get into scripting. In all the years I have used Gimp, I think I only once got a script-fu batch to work Wink

There is a GUI option BIMP see: https://alessandrofrancesconi.it/projects/bimp/  There is a Windows installer. Read the info on the site, examples are shown.

You can add a folder of images

[attachment=9108]

Use other Gimp procedure and search for auto. It say it is deprecated but works anyway

[attachment=9109]

Always best to export to another folder "just in case"

[attachment=9110]

Set it going, BIMP does not break any speed records but better than one-at-a-time

However, if you need a script-fu procedure, I am sure Ofnuts will assist.
I am familar with BIMP.

The Auto-White Balance at its details is a mystery, in otherwords propriatary information. I need to understand how it works to replicate it with script-fu.

I will make it a project to be completed someday.

Much thanks for your help.
Gimp is a free software, so everything is freely available online, there is no "propriatary information".

The description of what happens is in the documentation : https://docs.gimp.org/en/gimp-layer-white-balance.html
The implementation of the algorithm is here and deeper here.