---
title: "Assign a color profile to a bitmap"
canonical: https://www.graphicsmill.com/samples/ColorManagement/ColorProfile/SetEmbeddedProfile_cs
product: "Graphics Mill"
source: "ColorManagement/ColorProfile/SetEmbeddedProfile.cs"
---

# Assign a color profile to a bitmap

Replaces the embedded color profile of an image with a new one.

## Instruction

Sets the embedded color profile of an image to sRGB and saves it.

## Code Snippet

```csharp
using (var bitmap = new Bitmap("Chicago.jpg"))
{
    bitmap.ColorProfile = ColorProfile.FromSrgb();

    bitmap.Save("SetEmbeddedProfile.jpg");
}
```

## Explanation

The following code:

- Loads the image (`Chicago.jpg`).
- Assigns the embedded color profile to the image using `ColorProfile.FromSrgb()`.
- Saves the image (`SetEmbeddedProfile.jpg`) with the newly set embedded sRGB color profile.

## Tags

- [Bitmap](<https://www.graphicsmill.com/samples/tags/bitmap_md>): Working with images via the Bitmap API
- [Color Management](<https://www.graphicsmill.com/samples/tags/color-management_md>): Color management with ICC profiles
- [Color Profile](<https://www.graphicsmill.com/samples/tags/color-profile_md>): Using ICC color profiles
- [Write](<https://www.graphicsmill.com/samples/tags/write_md>): Writing images with codecs

## Input

- [Chicago.jpg](<https://www.graphicsmill.com/samples/ColorManagement/compiled/Debug/Chicago_jpg>) (preview)

## Output

- [SetEmbeddedProfile.jpg](<https://www.graphicsmill.com/samples/ColorManagement/compiled/Debug/SetEmbeddedProfile_jpg>) (preview)

## Used APIs

- [Aurigma.GraphicsMill.Bitmap.ColorProfile](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Bitmap_ColorProfile.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>)
