---
title: "Brightness Contrast"
canonical: https://www.graphicsmill.com/samples/Transforms/BrightnessAndContrast/BrightnessContrast_cs
product: "Graphics Mill"
source: "Transforms/BrightnessAndContrast/BrightnessContrast.cs"
---

# Brightness Contrast

Adjusts brightness/contrast.

## Instruction

Adjust the brightness and contrast of an image with specific factors.

## Code Snippet

```csharp
using (var bitmap = new Bitmap("Chicago.jpg"))
{
    bitmap.ColorAdjustment.BrightnessContrast(0.1f, 0.2f);

    bitmap.Save("BrightnessContrast.jpg");
}
```

## Explanation

The code:

- Applies a brightness adjustment with a factor of `0.1f` and a contrast adjustment with a factor of `0.2f` to the image.
- Saves the modified image with the adjusted brightness and contrast.

## 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

- [BrightnessContrast.jpg](<https://www.graphicsmill.com/samples/Transforms/compiled/Debug/BrightnessContrast_jpg>) (preview)

## Used APIs

- [Aurigma.GraphicsMill.Bitmap.ColorAdjustment](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Bitmap_ColorAdjustment.htm.md>)
- [Aurigma.GraphicsMill.ColorAdjustmentProvider.BrightnessContrast(Single,Single)](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_ColorAdjustmentProvider_BrightnessContrast_2_427c5821.htm.md>)
