---
title: "Channel Balance"
canonical: https://www.graphicsmill.com/samples/Transforms/ColorAdjustment/ChannelBalance_cs
product: "Graphics Mill"
source: "Transforms/ColorAdjustment/ChannelBalance.cs"
---

# Channel Balance

Modifies channel balance.

## Instruction

Adjust the channel balance of an image by modifying specific color channels in a `Bitmap` object.

## Code Snippet

```csharp
using (var bitmap = new Bitmap("Chicago.jpg"))
{
    // Pixel format specifies the order of channels
    // Example: Format24bppRgb - [Blue]|[Green]|[Red]
    // http://www.graphicsmill.com/docs/gm/accessing-pixel-data.htm#PixelsInMemory
    bitmap.ColorAdjustment.ChannelBalance(new float[] { 0.0f, 0.0f, 0.3f }, new float[] { 1f, 1f, 1f });

    bitmap.Save("ChannelBalance.jpg");
}
```

## Explanation

The code:

- Applies a channel balance adjustment where the blue and green channels are unchanged (set to 0.0f) and
the red channel is increased by a factor of 0.3f.
- The result image is saved with the applied color channel adjustments.

## 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

- [ChannelBalance.jpg](<https://www.graphicsmill.com/samples/Transforms/compiled/Debug/ChannelBalance_jpg>) (preview)

## Used APIs

- [Aurigma.GraphicsMill.Bitmap.ColorAdjustment](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Bitmap_ColorAdjustment.htm.md>)
- [Aurigma.GraphicsMill.ColorAdjustmentProvider.ChannelBalance(Single\[\],Single\[\])](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_ColorAdjustmentProvider_ChannelBalance_2_9438b101.htm.md>)
