---
title: "Combine channels"
canonical: https://www.graphicsmill.com/samples/ColorManagement/Channels/CombineChannels_cs
product: "Graphics Mill"
source: "ColorManagement/Channels/CombineChannels.cs"
---

# Combine channels

Combines image channels from multiple sources into a single image.

## Instruction

Demonstrates how to combine image channels from multiple sources (C, M, Y, K) into a single image.

## Usings

```csharp
using Aurigma.GraphicsMill.Codecs;
```

## Code Snippet

```csharp
using (var writer = ImageWriter.Create("Copenhagen_CMYK_Combined.jpg"))
using (var combiner = new CmykChannelCombiner())
using (var readerC = ImageReader.Create("Copenhagen_C.png"))
using (var readerM = ImageReader.Create("Copenhagen_M.png"))
using (var readerY = ImageReader.Create("Copenhagen_Y.png"))
using (var readerK = ImageReader.Create("Copenhagen_K.png"))
{
    combiner.C = readerC;
    combiner.M = readerM;
    combiner.Y = readerY;
    combiner.K = readerK;

    Pipeline.Run(combiner + writer);
}
```

## Explanation

The following code:

- Reads the individual CMYK channels (C, M, Y, K) from TIFF files (`Copenhagen_C.tif`, `Copenhagen_M.tif`, `Copenhagen_Y.tif`, `Copenhagen_K.tif`) using `TiffReader`.
- Combines these channels into a single image using `CmykChannelCombiner`.
- Writes the resulting image with the combined CMYK channels to a `Copenhagen_CMYK_Combined.jpg` file.

## Tags

- [Channels](<https://www.graphicsmill.com/samples/tags/channels_md>): Reading and combining image channels
- [Pipeline](<https://www.graphicsmill.com/samples/tags/pipeline_md>): Working with images via the Pipeline API
- [Write](<https://www.graphicsmill.com/samples/tags/write_md>): Writing images with codecs

## Input

- [Copenhagen\_C.png](<https://www.graphicsmill.com/samples/ColorManagement/compiled/Debug/Copenhagen_C_png>) (preview)
- [Copenhagen\_M.png](<https://www.graphicsmill.com/samples/ColorManagement/compiled/Debug/Copenhagen_M_png>) (preview)
- [Copenhagen\_Y.png](<https://www.graphicsmill.com/samples/ColorManagement/compiled/Debug/Copenhagen_Y_png>) (preview)
- [Copenhagen\_K.png](<https://www.graphicsmill.com/samples/ColorManagement/compiled/Debug/Copenhagen_K_png>) (preview)

## Output

- [Copenhagen\_CMYK\_Combined.jpg](<https://www.graphicsmill.com/samples/ColorManagement/compiled/Debug/Copenhagen_CMYK_Combined_jpg>) (preview)

## Used APIs

- [Aurigma.GraphicsMill.CmykChannelCombiner](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_CmykChannelCombiner.htm.md>)
- [Aurigma.GraphicsMill.CmykChannelCombiner.C](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_CmykChannelCombiner_C.htm.md>)
- [Aurigma.GraphicsMill.CmykChannelCombiner.K](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_CmykChannelCombiner_K.htm.md>)
- [Aurigma.GraphicsMill.CmykChannelCombiner.M](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_CmykChannelCombiner_M.htm.md>)
- [Aurigma.GraphicsMill.CmykChannelCombiner.Y](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_CmykChannelCombiner_Y.htm.md>)
- [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>)
