Gimp-Forum.net
What is the "Levels>Auto Input Levels" operation actually doing? - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: General questions (https://www.gimp-forum.net/Forum-General-questions)
+--- Thread: What is the "Levels>Auto Input Levels" operation actually doing? (/Thread-What-is-the-Levels-Auto-Input-Levels-operation-actually-doing)

Pages: 1 2


What is the "Levels>Auto Input Levels" operation actually doing? - ajax - 01-29-2024

Unfortunately, the documentation I've been able to find says little to nothing about what is actually being done to the image when the "Auto Input Levels" button is selected on the "Color>Levels" tool.  The GIMP User Manual section says only "Auto: Performs an automatic setting of the levels." which is applied to All Channels.

This question arises as a result of what I'd call quite remarkable results that are produced by the Auto Input Levels when NOT being able to come even close to getting the same results by using the other available (e.g. manual) options for making adjustments.

The related image files were produced by scanning some pretty old film strips (35mm negatives).  For example, when the scanner produced image file is opened in GIMP and a jpg image is created before making any edits the result is as follows:

[Image: Neg101.Original.jpg]


Then when doing nothing other than applying "Color>Levels>Auto Input Levels" the similar jpg image file that results follows:

[Image: Neg101.AutoLevel.jpg]

To the extent that it might matter a screenshot of the tool ("Adjust Color Levels") values associated with the original image file shown above is as follows:

[Image: AdjustColorLevelsWindow.jpg]

Note:  When the "Auto Input Levels" button is selected the image is changed quite dramatically in this case but nothing gets changed/updated within the "Adjust Color Levels" window.

These examples are derived from using GIMP 2.20.36 on Windows.

My thinking is that "Auto" means the tool is doing the same things described in the documentation that I should be able to do manually.  One might even think that the window which shows changes when made manually could be updated to reveal what changes that are being made automatically.  Of course this is NOT possible if "Auto Input Levels" is doing something different than what a user can do on there own.  If so, it would be nice to at least know what kind of things are possible when selecting "Auto Input Levels" that cannot be done otherwise.


RE: What is the "Levels>Auto Input Levels" operation actually doing? - Ofnuts - 01-29-2024

AFAIK for each color channel individually it stretches the histogram so that the 2% levels with the lowest value becomes 0 and the 2% levels with the highest value become 255 (in other words, it automatically restores the black and white points in each color channel).


RE: What is the "Levels>Auto Input Levels" operation actually doing? - rich2005 - 01-29-2024

Quote:....
Note:  When the "Auto Input Levels" button is selected the image is changed quite dramatically in this case but nothing gets changed/updated within the "Adjust Color Levels" window. ...

If you bring up the histogram dock you do get a result showing when 'auto' is applied.

For an auto filter it is worth experimenting with the gmic plugin. There is a Colors -> Auto with couple of sliders and and some color space options and you do not get the 'comb-ing' as with the Gimp levels tool.  This a before / after

[attachment=11084]


RE: What is the "Levels>Auto Input Levels" operation actually doing? - sallyanne - 01-29-2024

Seems - to me, to be very similar to the 'Equalize Local Histogram' in GMIC. So as Ofnuts explained and Rich showed, that is what it is doing.


RE: What is the "Levels>Auto Input Levels" operation actually doing? - Ofnuts - 01-30-2024

In a thousand words, the before & after histograms:

[attachment=11086]



RE: What is the "Levels>Auto Input Levels" operation actually doing? - ajax - 01-30-2024

(01-29-2024, 06:30 PM)Ofnuts Wrote: AFAIK for each color channel individually it stretches the histogram so that the 2% levels with the lowest value becomes 0 and the 2% levels with the highest value become 255 (in other words, it automatically restores the black and white points in each color channel).
Still trying to digest your most recent post but this response makes me think you are suggesting that I'd need to work on each of the R/G/B channels separately.  I've always used the Value mode because I simply do NOT know what I'd be trying to accomplish by working on each channel separately.  With that, said, I did give it a try in this case.  Not sure how to figure out the 2% point but by separately moving the white and black points to their respective ends of the histogram for each channel I end up with result that is fairly close to what resulted from using Auto Input Levels.  Actually the colors look to be about the same but the contrast NOT quite as high.  I think I have a basic understanding about how to alter contrast using Tone Curves but NOT Levels.  Is that even possible?

Might this mean that it is time for me to learn more about how to use the Levels Tool to manipulate the individual R/G/B channels?  If so I'd love to find some documentation that explains particulars for different objectives that might be possible to achieve.  I'm afraid the GIMP User Manual is NOT too hlep fl in this respect.

(01-29-2024, 06:58 PM)rich2005 Wrote:
Quote:....
Note:  When the "Auto Input Levels" button is selected the image is changed quite dramatically in this case but nothing gets changed/updated within the "Adjust Color Levels" window. ...

If you bring up the histogram dock you do get a result showing when 'auto' is applied.

For an auto filter it is worth experimenting with the gmic plugin. There is a Colors -> Auto with couple of sliders and and some color space options and you do not get the 'comb-ing' as with the Gimp levels tool.  This a before / after
Thank you.  I hadn't thought of using the Histogram Dock but that does appear to address my desire.

I do have GMIC installed but lack experience actually using it.  It is worth a try but I should point out that my reason for posting this topic is NOT that I'm dissatisfied with the result from Auto Input Levels.  It is rather that the result is so remarkably good that I'd like to become more knowledgeable about what the tool is actually doing and hopefully make better use of it going forward.

(01-29-2024, 06:07 PM)ajax Wrote: ...

These examples are derived from using GIMP 2.20.36 on Windows.

...
I meant "GIMP 2.10.36".


RE: What is the "Levels>Auto Input Levels" operation actually doing? - Ofnuts - 01-30-2024

(01-30-2024, 04:51 PM)ajax Wrote: Still trying to digest your most recent post but this response makes me think you are suggesting that I'd need to work on each of the R/G/B channels separately.  I've always used the Value mode because I simply do NOT know what I'd be trying to accomplish by working on each channel separately. 

Definitely worth learning to work on individual channels when playing with very damaged photos (on regular photos you run the risk of color drifts)

(01-30-2024, 04:51 PM)ajax Wrote: With that, said, I did give it a try in this case.  Not sure how to figure out the 2% point but by separately moving the white and black points to their respective ends of the histogram for each channel I end up with result that is fairly close to what resulted from using Auto Input Levels.  Actually the colors look to be about the same but the contrast NOT quite as high.  I think I have a basic understanding about how to alter contrast using Tone Curves but NOT Levels.  Is that even possible?

Could be luck here. They possibly also tweak the middle values to have a more even spread of the channel values (the middle handle in the Levels dialog) and with some luck this could have this effect.

(01-30-2024, 04:51 PM)ajax Wrote: Might this mean that it is time for me to learn more about how to use the Levels Tool to manipulate the individual R/G/B channels?  If so I'd love to find some documentation that explains particulars for different objectives that might be possible to achieve.  I'm afraid the GIMP User Manual is NOT too hlep fl in this respect.

The Gimp manual tells you what each tool does in the workshop, but if you want a table you first have to bring the wood and to know which tool to use.


RE: What is the "Levels>Auto Input Levels" operation actually doing? - ajax - 01-31-2024

Well now look what I just did.  Consider the following:

[Image: Neg101.ManualLevel.jpg]

After making the adjustments (manually), separately on the R&G&B channels that I previously mentioned, I then went and followed the advice regarding adjustments to the channel identified as "Value" (i.e., R/G/B combined) and produced the above result.  While NOT exactly the same it is pretty close.  Also, by fiddling with the black and white point, in the Value Channel, just a bit more I'm pretty sure I could have made one that is indistinguishable from the one made using "Auto Input Levels".  If left to choose I'd likely have picked the one created manually.

While it might be a bit off subject I'm a little curious about why this (Auto Input Levels) capability is NOT included by the developers of my scanner software.  The original image shown above is NOT peculiar to this shot or film type but rather very common across the board (i.e., all images have the same properties).  Given that this comes from a negative there is a fair amount of conversion associated with producing the positive image.  Seems like an Auto Level adjustment ought to be an option at minimum.

Anyway, thanks for the help.  I've definitely learned some important things about the Levels Tool.


RE: What is the "Levels>Auto Input Levels" operation actually doing? - Ofnuts - 01-31-2024

(01-31-2024, 04:34 PM)ajax Wrote: Well now look what I just did.  Consider the following:

[Image: Neg101.ManualLevel.jpg]

After making the adjustments (manually), separately on the R&G&B channels that I previously mentioned, I then went and followed the advice regarding adjustments to the channel identified as "Value" (i.e., R/G/B combined) and produced the above result.  While NOT exactly the same it is pretty close.  Also, by fiddling with the black and white point, in the Value Channel, just a bit more I'm pretty sure I could have made one that is indistinguishable from the one made using "Auto Input Levels".  If left to choose I'd likely have picked the one created manually.

While it might be a bit off subject I'm a little curious about why this (Auto Input Levels) capability is NOT included by the developers of my scanner software.  The original image shown above is NOT peculiar to this shot or film type but rather very common across the board (i.e., all images have the same properties).  Given that this comes from a negative there is a fair amount of conversion associated with producing the positive image.  Seems like an Auto Level adjustment ought to be an option at minimum.

Anyway, thanks for the help.  I've definitely learned some important things about the Levels Tool.

Because "auto" anything isn't really predictable. Scanners are meant to mostly scan "normal" stuff, and so they aim for color accuracy.

Also "auto" isn't a good way to "fix" negatives. You don't want the result to look good, but to be accurate. There are better methods (CLUT based, with a CLUT for each film type).


RE: What is the "Levels>Auto Input Levels" operation actually doing? - ajax - 02-01-2024

It looks like CLUT refers to capability provided by GMIC.  GMIC does look to provide a very comprehensive set of capabilities that rivals, and maybe surpasses, those of other image processing software packages.  However, good/thorough documentation is what I'd need.  I've looked but have NOT been able to find documentation that satisfies this need.  This especially means how to use each of the many individual tools provided.  If such exists would love to know how to obtain it.