---
title: "Preview RGB To CMYK On Screen"
canonical: https://www.graphicsmill.com/samples/ColorManagement/RGBToCMYK/PreviewRgbToCmykOnScreen_cs
product: "Graphics Mill"
source: "ColorManagement/RGBToCMYK/PreviewRgbToCmykOnScreen.cs"
---

# Preview RGB To CMYK On Screen

Generates an RGB preview of CMYK color conversion.

## Instruction

Simulates how an RGB image would appear when printed in CMYK by performing a soft-proofing conversion.

## Code Snippet

```csharp
using (var bitmap = new Bitmap("Copenhagen_RGB.jpg"))
{
    if (bitmap.ColorProfile == null)
    {
        bitmap.ColorProfile = ColorProfile.FromSrgb();
    }

    bitmap.ColorManagement.TargetDeviceProfile = new ColorProfile("ISOcoated_v2_eci.icc");
    bitmap.ColorManagement.DestinationProfile = ColorProfile.FromScreen();

    bitmap.ColorManagement.Convert(PixelFormat.Format24bppRgb);

    bitmap.Save("PreviewRgbToCmykOnScreen.jpg");
}
```

## Explanation

The code:

- Loads "Copenhagen_RGB.jpg" into a `Bitmap`.
- Assigns the sRGB color profile if none is embedded.
- Sets a target device profile (e.g., "ISOcoated_v2_eci.icc") to simulate a CMYK press condition.
- Sets the destination profile to `ColorProfile.FromScreen()` to display the result as it would appear on screen.
- Converts the image to 24bpp RGB using soft-proofing (via `TargetDeviceProfile`).
- Saves the soft-proofed image to "PreviewRgbToCmykOnScreen.jpg".

## 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\_RGB.jpg](<https://www.graphicsmill.com/samples/ColorManagement/compiled/Debug/Copenhagen_RGB_jpg>) (preview)
- [ISOcoated\_v2\_eci.icc](<https://www.graphicsmill.com/samples/ColorManagement/compiled/Debug/ISOcoated_v2_eci_icc>) (download)

## Output

- [PreviewRgbToCmykOnScreen.jpg](<https://www.graphicsmill.com/samples/ColorManagement/compiled/Debug/PreviewRgbToCmykOnScreen_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.ColorManagementProvider.TargetDeviceProfile](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_ColorManagementProvider_TargetDeviceProfile.htm.md>)
- [Aurigma.GraphicsMill.ColorProfile](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_ColorProfile.htm.md>)
- [Aurigma.GraphicsMill.ColorProfile.FromScreen](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_ColorProfile_FromScreen.htm.md>)
- [Aurigma.GraphicsMill.ColorProfile.FromSrgb](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_ColorProfile_FromSrgb.htm.md>)
