---
title: "Contrast"
canonical: https://www.graphicsmill.com/samples/Transforms/BrightnessAndContrast/Contrast_cs
product: "Graphics Mill"
source: "Transforms/BrightnessAndContrast/Contrast.cs"
---

# Contrast

Adjusts contrast.

## Instruction

Apply a contrast adjustment to an image.

## Code Snippet

```csharp
using (var bitmap = new Bitmap("Chicago.jpg"))
{
    bitmap.ColorAdjustment.Contrast(0.1f);

    bitmap.Save("Contrast.jpg");
}
```

## Explanation

The code:

- Adjusts the contrast of the image by `0.1f` using the `Contrast` transform.
- The transformation is applied directly to the image.
- Saves the image with the applied contrast adjustment.

## 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

- [Contrast.jpg](<https://www.graphicsmill.com/samples/Transforms/compiled/Debug/Contrast_jpg>) (preview)

## Used APIs

- [Aurigma.GraphicsMill.Bitmap.ColorAdjustment](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Bitmap_ColorAdjustment.htm.md>)
- [Aurigma.GraphicsMill.ColorAdjustmentProvider.Contrast(Single)](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_ColorAdjustmentProvider_Contrast_1_7a94462e.htm.md>)
