Gimp-Forum.net
Script-fu How Write Colors-Auto-White Balance - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP)
+---- Forum: Scripting questions (https://www.gimp-forum.net/Forum-Scripting-questions)
+---- Thread: Script-fu How Write Colors-Auto-White Balance (/Thread-Script-fu-How-Write-Colors-Auto-White-Balance)



Script-fu How Write Colors-Auto-White Balance - James Parkinson - 12-02-2022

I have not found a way to write Colors-Auto-White Balance within Script-fu. Please advise how to do this.


RE: Script-fu How Write Colors-Auto-White Balance - Ofnuts - 12-02-2022

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.


RE: Script-fu How Write Colors-Auto-White Balance - James Parkinson - 12-02-2022

(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.


RE: Script-fu How Write Colors-Auto-White Balance - rich2005 - 12-02-2022

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.


RE: Script-fu How Write Colors-Auto-White Balance - James Parkinson - 12-02-2022

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.


RE: Script-fu How Write Colors-Auto-White Balance - tmanni - 12-03-2022

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.