Change pixels, not colors
- Convert between RGB/CMYK/Grayscale color spaces
- Fine tune color conversion with intents
- Manage color profiles
- Optional Adobe CMM engine available
- CIELab color space supported
Change pixels, not colors
Converting an image between different color spaces (especially between CMYK and RGB) may lead to significant color distortions. To avoid this and keep colors natural, color conversions should be done using color management.
It is very easy in Graphics Mill - all you need to do is provide input and output color profiles. Input color profiles are typically embedded into a source file. Output profiles are provided with the printer, monitor or other device where you output the image. You can convert both bitmaps and individual color values.
View code samplesTypically, it is enough just to enable color management and specify profiles. However if necesssary, you can make additional adjustments:
using (var bitmap = new Bitmap("RGB.jpg"))
{
if (bitmap.ColorProfile == null)
{
bitmap.ColorProfile = ColorProfile.FromSrgb();
}
bitmap.ColorManagement.DestinationProfile = new ColorProfile("ISOcoated_v2_eci.icc");
bitmap.ColorManagement.TransformationIntent = ColorTransformationIntent.Perceptual;
bitmap.ColorManagement.Convert(PixelFormat.Format32bppCmyk);
bitmap.Save("CMYK.jpg");
}
Classic color spaces such as RGB and CMYK have a serious shortcoming - they are device dependant. The same pixel value looks different on different output devices. That's why you have to deal with color profiles when switching between color spaces.
Another problem is that RGB/CMYK pixels mix information about colors and luminosity together. If you want to change brightness, you will affect the colors as well.
To address these issues, a device-independent color space known as CIE Lab was invented. Its L channel contains the information about lightness, separated from colors, so you can manipulate it without fear of spoiling the colors.
