First. the -auto-level and -auto-gamma are part of a set of new functions that will eventually replace the current invocations of the -normalize, -contrast-stretch -linear-stretch all of which were ill defined and difficult to understand, exactly what they did.
What I want to see is a more 'generalised' handling where the various options and methods
can be controled more exactly.
The new functions were going to be named -histogram ???? methods, and were going to make maximum use of 'level' style stretching (for accuracy), with minimal use of histogram binning for reassigning colors. They would also make use of extra 'channel swicthes'
Some notes about this was given in..
http://www.imagemagick.org/Usage/bugs/f ... auto-level
Though these are not my core notes.
The -auto-level operator makes direct use of the exact 'maximum and minimum values' without resorting to the use of 'histogram bins', making it a more 'mathematically correct' normalization.
It also made use of a 'new' channel switch called 'sync', which by default is turned on.
For example
-channel RGB,sync -auto-level
When 'sync' is enabled, operators that understand this flag would adjust all color channels in sync, that is in the same way.
I am planing to make ALL histogram operators understand this flag, as well as other options to provide the more exact controls that was needed.
I had planned to work on this during the new year break, but morphology got my attention instead.
I just never seem to get time otherwise, and lack of people programming IM is the major problem.
Internally, all histogram function should be added to and moved into the 'histogram.c' module. However it seems Cristy has added many functions into this module, which I don't know about, but seems to be histogram generator functions.
Before this functions were placed in the module 'enhance.c' which is also where the normalize and 'level' functions live.
The function MinMaxStretchImage() is what performs the actual 'auto-level' operation, and for 'color percentage' clipping of the histogram.