---
title: "Convert CMYK to RGB"
canonical: https://www.graphicsmill.com/samples/ColorManagement/ConvertingPixelFormats/ConvertCmykToRgb_cs
product: "Graphics Mill"
source: "ColorManagement/ConvertingPixelFormats/ConvertCmykToRgb.cs"
---

# Convert CMYK to RGB

Converts color space from CMYK to RGB with color management.

## Instruction

Converts a CMYK image without a color profile to RGB using a default color profile and saves the result.

## Code Snippet

```csharp
using (var bitmap = new Bitmap("Copenhagen_CMYK_NoColorProfile.jpg"))
{
    // Assign some default color profile
    if (bitmap.ColorProfile == null)
    {
        bitmap.ColorProfile = new ColorProfile("ISOcoated_v2_eci.icc");
    }

    bitmap.ColorManagement.DestinationProfile = ColorProfile.FromSrgb();

    bitmap.ColorManagement.Convert(PixelFormat.Format24bppRgb);

    bitmap.Save("PF_ConvertCmykToRgb.jpg");
}
```

## Explanation

The code:

- Loads the CMYK image ("Copenhagen_CMYK_NoColorProfile.jpg") into a `Bitmap`.
- If the image does not have a color profile, assigns a default color profile ("ISOcoated_v2_eci.icc").
- Sets the destination color profile to `sRGB` using `ColorProfile.FromSrgb()`.
- Converts the image from CMYK to RGB using `ColorManagement.Convert`.
- Saves the result as "PF_ConvertCmykToRgb.jpg" using the `Save` method with the new RGB format.

## Tags

- [Bitmap](<https://www.graphicsmill.com/samples/tags/bitmap_md>): Working with images via the Bitmap API
- [Color Conversion](<https://www.graphicsmill.com/samples/tags/color-conversion_md>): Converting colors between color spaces
- [Color Management](<https://www.graphicsmill.com/samples/tags/color-management_md>): Color management with ICC profiles

## Input

- [Copenhagen\_CMYK\_NoColorProfile.jpg](<https://www.graphicsmill.com/samples/ColorManagement/compiled/Debug/Copenhagen_CMYK_NoColorProfile_jpg>) (preview)
- [ISOcoated\_v2\_eci.icc](<https://www.graphicsmill.com/samples/ColorManagement/compiled/Debug/ISOcoated_v2_eci_icc>) (download)

## Output

- [PF\_ConvertCmykToRgb.jpg](<https://www.graphicsmill.com/samples/ColorManagement/compiled/Debug/PF_ConvertCmykToRgb_jpg>) (preview)

## Used APIs

- [Aurigma.GraphicsMill.Bitmap.ColorManagement](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Bitmap_ColorManagement.htm.md>)
- [Aurigma.GraphicsMill.Bitmap.ColorProfile](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Bitmap_ColorProfile.htm.md>)
- [Aurigma.GraphicsMill.ColorManagementProvider.Convert(PixelFormat)](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_ColorManagementProvider_Convert_1_3e209c07.htm.md>)
- [Aurigma.GraphicsMill.ColorManagementProvider.DestinationProfile](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_ColorManagementProvider_DestinationProfile.htm.md>)
- [Aurigma.GraphicsMill.ColorProfile](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_ColorProfile.htm.md>)
- [Aurigma.GraphicsMill.ColorProfile.FromSrgb](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_ColorProfile_FromSrgb.htm.md>)
