Page 1 of 1

Convert rgb to cmyk

Posted: 2014-03-24T14:09:30-07:00
by lumaluis
Hi, I need to convert the images that I upload to cmyk, right now the images are in rgb?
This lib can help me to make this happen?

Re: Convert rgb to cmyk

Posted: 2014-03-24T14:49:36-07:00
by dlemstra
You can use the following code to accomplish this:

Code: Select all

using (MagickImage image = new MagickImage("Input.png"))
{
  image.ColorAlpha(new MagickColor("#FFF")); // You only need this when your image contains transparency.
  image.AddProfile(ColorProfile.SRGB);
  image.AddProfile(ColorProfile.USWebCoatedSWOP);
  image.Write("Output.jpg");
}
If you need more help please check the documentation here: https://magick.codeplex.com/documentation or feel free to start a topic here: https://magick.codeplex.com/discussions.