// Load color profiles and convert an image from CMYK into RGB color space.
// Get the base path for the running executable.
string exePath = Assembly.GetExecutingAssembly().Location;
Int32 nIndex = exePath.LastIndexOf("\\");
exePath = exePath.Remove(nIndex + 1, exePath.Length - nIndex - 1);
// Read color profiles from the executable's path.
using (FileStream fs = File.OpenRead(exePath + "ig_cmyk_profile.icm"))
ImGearColorProfileManager.CmykProfile = new ImGearColorProfile(fs);
using (FileStream fs = File.OpenRead(exePath + "ig_rgb_profile.icm"))
ImGearColorProfileManager.RgbProfile = new ImGearColorProfile(fs);
// Convert an opened CMYK image into the RGB colorspace using ImageGear color profiles.
ImGearRasterProcessing.ConvertColorSpace(igRasterPage,
new ImGearColorSpace(ImGearColorSpaceIDs.RGB), ImGearColorProfileManager.CmykProfile,
ImGearColorProfileManager.RgbProfile, ImGearRenderingIntents.PERCEPTUAL);