---
title: "Combine Channels"
canonical: https://www.graphicsmill.com/samples/LargeImages/ChannelManipulations/CombineChannels_cs
product: "Graphics Mill"
source: "LargeImages/ChannelManipulations/CombineChannels.cs"
---

# Combine Channels

Merges separate image channels into a single RGB image using Pipeline API.

## Instruction

Combine separate RGB channels from three images (red, green, and blue) to create a full-color image using Pipeline API.

## Usings

```csharp
using Aurigma.GraphicsMill.Codecs;
```

## Code Snippet

```csharp
using (var writer = ImageWriter.Create("PipelineCombineChannels.jpg"))
using (var combiner = new RgbChannelCombiner())
using (var readerR = new PngReader("Chicago_R.png"))
using (var readerG = new PngReader("Chicago_G.png"))
using (var readerB = new PngReader("Chicago_B.png"))
{
    combiner.R = readerR;
    combiner.G = readerG;
    combiner.B = readerB;
    Pipeline.Run(combiner + writer);
}
```

## Explanation

The code:

- Reads three images: "Chicago_R.png", "Chicago_G.png", and "Chicago_B.png" (representing the red, green, and blue channels).
- Combines these channels into a single full-color image using Pipeline API.
- Saves the result as "PipelineCombineChannels.jpg".

## 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\_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)

## Output

- [PipelineCombineChannels.jpg](<https://www.graphicsmill.com/samples/LargeImages/compiled/Debug/PipelineCombineChannels_jpg>) (preview)

## Used APIs

- [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.Codecs.PngReader](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_PngReader.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>)
