Convert rgb to cmyk

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
Post Reply
lumaluis
Posts: 3
Joined: 2014-03-24T14:07:12-07:00
Authentication code: 6789

Convert rgb to cmyk

Post 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?
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Convert rgb to cmyk

Post 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.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Post Reply