---
title: "Split channels"
canonical: https://www.graphicsmill.com/samples/ColorManagement/Channels/SplitChannels_cs
product: "Graphics Mill"
source: "ColorManagement/Channels/SplitChannels.cs"
---

# Split channels

Extracts individual channels from a CMYK image using channel splitter and saves them as separate files.

## Instruction

Demonstrates how to split a CMYK image into separate channels and save each channel as a TIFF file.

## Usings

```csharp
using Aurigma.GraphicsMill.Codecs;
```

## Code Snippet

```csharp
using (var reader = ImageReader.Create("Copenhagen_CMYK.jpg"))
using (var splitter = new CmykChannelSplitter())
using (var writerC = new PngWriter("Copenhagen_C.png"))
using (var writerM = new PngWriter("Copenhagen_M.png"))
using (var writerY = new PngWriter("Copenhagen_Y.png"))
using (var writerK = new PngWriter("Copenhagen_K.png"))
{
    splitter.C = writerC;
    splitter.M = writerM;
    splitter.Y = writerY;
    splitter.K = writerK;

    Pipeline.Run(reader + splitter);
}
```

## Explanation

The following code:

- Reads a CMYK image (`Copenhagen_CMYK.jpg`) using `ImageReader`.
- Splits the image into its C, M, Y, and K channels using `CmykChannelSplitter`.
- Saves each channel into separate TIFF files: `Copenhagen_C.tif`, `Copenhagen_M.tif`, `Copenhagen_Y.tif`, and `Copenhagen_K.tif`.

## 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
- [Read](<https://www.graphicsmill.com/samples/tags/read_md>): Reading images with codecs

## Input

- [Copenhagen\_CMYK.jpg](<https://www.graphicsmill.com/samples/ColorManagement/compiled/Debug/Copenhagen_CMYK_jpg>) (preview)

## Output

- [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)

## Used APIs

- [Aurigma.GraphicsMill.CmykChannelSplitter](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_CmykChannelSplitter.htm.md>)
- [Aurigma.GraphicsMill.CmykChannelSplitter.C](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_CmykChannelSplitter_C.htm.md>)
- [Aurigma.GraphicsMill.CmykChannelSplitter.K](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_CmykChannelSplitter_K.htm.md>)
- [Aurigma.GraphicsMill.CmykChannelSplitter.M](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_CmykChannelSplitter_M.htm.md>)
- [Aurigma.GraphicsMill.CmykChannelSplitter.Y](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_CmykChannelSplitter_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.PngWriter](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_PngWriter.htm.md>)
