GNOME Bugzilla – Bug 119233
There is no PDB entry for auto-level, so it can't be used from script-fu.
Last modified: 2004-12-22 21:47:04 UTC
Description of Problem: There seems to be no way to perform an auto-level (Layer/Colors/Levels/Auto on the 1.3 GUI) from a script. Please add a function to the PDB to provide the needed interface. It looks like fixing this is just a matter of adding the code in color.pdb to call levels_auto (from app/base/levels.h). My perl is really weak (i.e. nonexistant) or I'd submit a patch.
Would this really add any features that the Equalize (or Normalize, I forget, and I don't have gimp with me here at work :( ) plug-in doesn't already provide?
That's a good question, Nathan. I'm not sure exactly what equalize (it is called equalize, I found it in the PDB) does. Is it precisely the same as auto-level? It certainly sounds similar. Looking at the code, it's not obvious to me that they're the same.
I should have done a little testing first, then responded. Equalize and auto-level are different operations. Equalize produces almost perfectly flat histograms, and the effect of that on most images isn't very pleasant. Auto-level just cuts off the ends of each histogram and then stretches the rest across the full range out output levels. That is unpleasant for some images, but very nice for most.
I think I've got this figured out; I'll post a patch shortly. (This is just so no one else wastes any time looking at it until I either succeed or give up :) ).
Created attachment 19053 [details] [review] Patch to add levels_auto to PDB
Should be considered for inclusion in 1.3.
2003-08-31 Sven Neumann <sven@gimp.org> * tools/pdbgen/pdb/color.pdb: applied a patch from Shawn Willden that adds the new PDB function levels_auto. * app/pdb/color_cmds.c * app/pdb/internal_procs.c * libgimp/gimpcolor_pdb.[ch]: regenerated.
*** Bug 84835 has been marked as a duplicate of this bug. ***