Yeah, it's very simple, but quite effective and here and there miraculous, too!

It figures out the brightest and the lowest color of an image and stretches the colors to go from full brightness to full darkest.. kind of like auto contrast, in a way. If a picture has white and black, though, nothing will happen.
It also does that per channel (red, green and blue). That's why it is so simple. I had another variation where it did something more clever, but it was too risky. I'll do that later again nicely.
For now, this is the most primitive auto level implementation imaginable, I think.