How to automatically adjust the levels of a grayscale I want to generate a greyscale to apply a color ramp on it to generate my texture. In order to get the most value depth on this greyscale i want to adjust the levels in the compositor so the darkest color gets a value of 0 and the brightest color has a value of 1. I want Blender to detect the values automatically like the Auto Level node of Substance Designer.

Here is an image i have created for the test with bad levels:



And the result I want to generate in the compositor with automatic detection:
Sure just grab a Normalise node from the Vector node category.



And you can apply this to colour images by separating out the value component.
In this example I have intentionally underexposed the source using a colour curve node. You can compare the results in the split viewer node.



A useful application would be to smooth out exposure of time-lapse recordings. Where lighting conditions and therefore exposure, change radical during a recording.