---
title: "Auto Brightness"
canonical: https://www.graphicsmill.com/samples/Transforms/BrightnessAndContrast/AutoBrightness_cs
product: "Graphics Mill"
source: "Transforms/BrightnessAndContrast/AutoBrightness.cs"
---

# Auto Brightness

Adjusts brightness automatically.

## Instruction

Apply automatic brightness adjustment to an image.

## Code Snippet

```csharp
using (var bitmap = new Bitmap("Chicago.jpg"))
{
    bitmap.ColorAdjustment.AutoBrightness();

    bitmap.Save("AutoBrightness.jpg");
}
```

## Explanation

The code:

- Uses the `AutoBrightness` method to adjust the brightness of the image automatically.
- Saves the modified image to a new file.

## Tags

- [Bitmap](<https://www.graphicsmill.com/samples/tags/bitmap_md>): Working with images via the Bitmap API
- [Color Adjustment](<https://www.graphicsmill.com/samples/tags/color-adjustment_md>): Adjusting brightness, contrast and color

## Input

- [Chicago.jpg](<https://www.graphicsmill.com/samples/Transforms/compiled/Debug/Chicago_jpg>) (preview)

## Output

- [AutoBrightness.jpg](<https://www.graphicsmill.com/samples/Transforms/compiled/Debug/AutoBrightness_jpg>) (preview)

## Used APIs

- [Aurigma.GraphicsMill.Bitmap.ColorAdjustment](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Bitmap_ColorAdjustment.htm.md>)
- [Aurigma.GraphicsMill.ColorAdjustmentProvider.AutoBrightness](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_ColorAdjustmentProvider_AutoBrightness.htm.md>)
