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: