---
title: "Split Channels"
canonical: https://www.graphicsmill.com/samples/LargeImages/ChannelManipulations/SplitChannels_cs
product: "Graphics Mill"
source: "LargeImages/ChannelManipulations/SplitChannels.cs"
---

# Split Channels

Split the RGB channels of an image, adjust their brightness individually, and save each channel as a separate image.

## Instruction

Split the RGB channels of an image, adjust their brightness individually, and save each channel as a separate image.

## Usings

```csharp
using Aurigma.GraphicsMill.Codecs;
using Aurigma.GraphicsMill.Transforms;
```

## Code Snippet

```csharp
using (var reader = ImageReader.Create("Chicago.jpg"))
using (var splitter = new RgbChannelSplitter())
using (var brightnessR = new Brightness(0.1f))
using (var writerR = new PngWriter("Chicago_R.png"))
using (var brightnessG = new Brightness(0.2f))
using (var writerG = new PngWriter("Chicago_G.png"))
using (var brightnessB = new Brightness(-0.1f))
using (var writerB = new PngWriter("Chicago_B.png"))
{
    splitter.R = brightnessR;
    brightnessR.Receivers.Add(writerR);

    splitter.G = brightnessG;
    brightnessG.Receivers.Add(writerG);

    splitter.B = brightnessB;
    brightnessB.Receivers.Add(writerB);

    Pipeline.Run(reader + splitter);
}
```

## Explanation

The code:

- Reads the image "Chicago.jpg".
- Splits the image into its red, green, and blue channels.
- Adjusts the brightness of the red channel by 0.1, the green channel by 0.2, and the blue channel by -0.1.
- Saves the modified red channel as "Chicago_R.png", the green channel as "Chicago_G.png", and the blue channel as "Chicago_B.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

- [Chicago\_R.png](<https://www.graphicsmill.com/samples/LargeImages/compiled/Debug/Chicago_R_png>) (preview)
- [Chicago\_G.png](<https://www.graphicsmill.com/samples/LargeImages/compiled/Debug/Chicago_G_png>) (preview)
- [Chicago\_B.png](<https://www.graphicsmill.com/samples/LargeImages/compiled/Debug/Chicago_B_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.PngWriter](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_PngWriter.htm.md>)
- [Aurigma.GraphicsMill.PipelineElement.Receivers](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_PipelineElement_Receivers.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>)
