I tried the following:
convert 1.jpg -auto-level output.jpg
vs.using (var image = new ImageMagick.MagickImage("1.jpg"))
{
image.AutoLevel();
image.Write("output.jpg");
}
vs.using (var image = new ImageMagick.MagickImage("1.jpg"))
{
double min = 100 * image.Statistics().Composite().Minimum / Quantum.Max;
double max = 100 * image.Statistics().Composite().Maximum / Quantum.Max;
image.Level(new Percentage(min), new Percentage(max));
image.Write("output.jpg");
}
I get the same results from 1 & 3.