---
title: "ColorAdjustmentProvider..::.AutoLevels Method (Double, array&lt;Boolean&gt;[]()[], HistogramMode)"
canonical: https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_ColorAdjustmentProvider_AutoLevels_3_73a54872.htm
product: "Graphics Mill 5.5 for .NET"
---

This documentation is for the old version. [Go to the latest Graphics Mill docs](https://www.graphicsmill.com/docs/gm/)

# ColorAdjustmentProvider.AutoLevels Method (Double, Boolean[], HistogramMode)
 
Automatically applies levels adjustment to specified channels using provided threshold level and histogram mode.
 
**Namespace:** [Aurigma.GraphicsMill](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```
Public Sub AutoLevels ( _threshold As Double, _channels As Boolean(), _histogramMode As HistogramMode _
)
```
 
```csharp
public void AutoLevels(double threshold,bool[] channels,HistogramMode histogramMode
)
```
 
### Parameters
 
 - threshold
     - Type: [System.Double](http://msdn2.microsoft.com/en-us/643eft0t)
 
Threshold level of the automatic level correction algorithm (sensitivity).
 
The threshold value is used to define a percent of pixels on edges of the tonal range to discard. Threshold = 1 is 100% of pixels. To get more or less realistic result, use a value less than 1% (0.01). For example:
 
- If you want to get a result similar to Photoshop® 7, use 0.5% (0.005).
- If you want a result similar to Photoshop CS or later, use 0.1% (0.001).

 - channels
     - Type:  [System.Boolean](http://msdn2.microsoft.com/en-us/a28wyd50) []
Array of flags specifying what channels to apply effect at. If an array item is **true**, the transform will be applied at the channel with the appropriate index. Otherwise the channel is skipped.

 - histogramMode
     - Type: [Aurigma.GraphicsMill.HistogramMode](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_HistogramMode.htm.md)
 [HistogramMode](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_HistogramMode.htm.md) value that specifies how to build the image histogram.
 
## Remarks
  
You can also use [Levels](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Transforms_Levels.htm.md) class to apply this correction (with [Auto](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Transforms_Levels_Auto.htm.md) property set to **true**).
   
## See Also

### Reference

- [ColorAdjustmentProvider Class](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_ColorAdjustmentProvider.htm.md)
- [AutoLevels Overload](https://www.graphicsmill.com/docs/gm5/O_T_Aurigma_GraphicsMill_ColorAdjustmentProvider_AutoLevels.htm.md)
- [Aurigma.GraphicsMill Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill.htm.md)
