---
title: "Split And Combine Channels"
canonical: https://www.graphicsmill.com/samples/LargeImages/ChannelManipulations/SplitAndCombineChannels_cs
product: "Graphics Mill"
source: "LargeImages/ChannelManipulations/SplitAndCombineChannels.cs"
---

# Split And Combine Channels

Splits an image into its RGB channels, adjusts each channel's brightness, and recombines them.

## Instruction

Split the RGB channels of an image, adjust their brightness, and then recombine them to create a modified image.

## Usings

```csharp
using Aurigma.GraphicsMill.Codecs;
using Aurigma.GraphicsMill.Transforms;
```

## Code Snippet

```csharp
using (var reader = ImageReader.Create("Chicago.jpg"))
using (var channelSplitter = new RgbChannelSplitter())
using (var brightnessR = new Brightness(0.1f))
using (var brightnessG = new Brightness(-0.05f))
using (var brightnessB = new Brightness(0.2f))
using (var channelCombiner = new RgbChannelCombiner())
using (var writer = ImageWriter.Create("SplitAndCombineChannels.png"))
{
    reader.Receivers.Add(channelSplitter);

    channelCombiner.R = channelSplitter.R + brightnessR;
    channelCombiner.G = channelSplitter.G + brightnessG;
    channelCombiner.B = channelSplitter.B + brightnessB;

    Pipeline.Run(channelCombiner + writer);
}
```

## Explanation

The code:

- Reads the image "Chicago.jpg".
- Splits the image into its red, green, and blue channels.
- Adjusts the brightness of the red, green, and blue channels individually.
- Combines the modified channels back together into a single image.
- Saves the result as "SplitAndCombineChannels.png".

## Tags

- [Branched Pipeline](<https://www.graphicsmill.com/samples/tags/branched-pipeline_md>): Building branched processing pipelines
- [Channels](<https://www.graphicsmill.com/samples/tags/channels_md>): Reading and combining image channels

## Input

- [Chicago.jpg](<https://www.graphicsmill.com/samples/LargeImages/compiled/Debug/Chicago_jpg>) (preview)

## Output

- [SplitAndCombineChannels.png](<https://www.graphicsmill.com/samples/LargeImages/compiled/Debug/SplitAndCombineChannels_png>) (preview)

## Used APIs

- [Aurigma.GraphicsMill.Codecs.ImageReader](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_ImageReader.htm.md>)
- [Aurigma.GraphicsMill.Codecs.ImageReader.Create(String)](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Codecs_ImageReader_Create_1_bb3a7a4f.htm.md>)
- [Aurigma.GraphicsMill.Codecs.ImageWriter](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_ImageWriter.htm.md>)
- [Aurigma.GraphicsMill.Codecs.ImageWriter.Create(String)](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Codecs_ImageWriter_Create_1_bb3a7a4f.htm.md>)
- [Aurigma.GraphicsMill.PipelineElement.Receivers](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_PipelineElement_Receivers.htm.md>)
- [Aurigma.GraphicsMill.RgbChannelCombiner](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_RgbChannelCombiner.htm.md>)
- [Aurigma.GraphicsMill.RgbChannelCombiner.B](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_RgbChannelCombiner_B.htm.md>)
- [Aurigma.GraphicsMill.RgbChannelCombiner.G](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_RgbChannelCombiner_G.htm.md>)
- [Aurigma.GraphicsMill.RgbChannelCombiner.R](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_RgbChannelCombiner_R.htm.md>)
- [Aurigma.GraphicsMill.RgbChannelSplitter](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_RgbChannelSplitter.htm.md>)
- [Aurigma.GraphicsMill.RgbChannelSplitter.B](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_RgbChannelSplitter_B.htm.md>)
- [Aurigma.GraphicsMill.RgbChannelSplitter.G](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_RgbChannelSplitter_G.htm.md>)
- [Aurigma.GraphicsMill.RgbChannelSplitter.R](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_RgbChannelSplitter_R.htm.md>)
- [Aurigma.GraphicsMill.Transforms.Brightness](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Transforms_Brightness.htm.md>)
