I have a requirement for converting and saving an image in CMYK format. When i have uploaded an image of RGB format, then i need to convert it to CMYK. Is it possible in .Net? Thanks
-
possible duplicate of [Convert RGB color to CMYK?](http://stackoverflow.com/questions/2426432/convert-rgb-color-to-cmyk) – Brian Rasmussen Apr 05 '12 at 17:58
5 Answers
As others mentioned .NET does not natively support image colorspace adjustments.
However, ImageMagick is excellent free software suite that will alow you to do this using the -colorspace or -profile option.
The .NET library that will allow you to tap into ImageMagick is conveniently named ImageMagick.NET, it can be downloaded from Codeplex...

- 11,878
- 8
- 54
- 108
I don't know the first thing about .Net but I saw a web site where you can perform free RGB to CMYK conversions on your image files up to 5mb. You get a choice of numerous CMYK profiles. For U.S. commercial offset printing, I would recommend GRACoL2006_Coated1v2.icc and for magazine/web offset I'd use SWOP2006_Coated3v2.icc
http://www.rgb2cmyk.org/

- 11
- 1
There is no native CMYK support in .NET. You will need a third party library or service, or to write your own. It's not exactly simple to convert an image to CMYK, and each purpose will have different requirements, so you really need to define the requirement better in order to decide which method to use.
Edit: The sidebar had a link to a previous question that had some answers: Convert RGB color to CMYK?
You can do this with ImageMagick for .Net, called Magick.Net. You can install it via Nuget, and it's free.
Color profile conversion is pretty confusing in Magick.Net. You might wonder if it's magick.TransformColorSpace
, or based on some command-line based answers, magick.Negate()
. But it's neither. Instead you "Add" the existing ColorProfile, which feels wrong, then Add the one you want to convert to, and Magick.Net handles the details of the conversion in the background for you.
// Tell ImageMagick this is RGB
magick.AddProfile(ColorProfile.SRGB);
// Tell it to convert it.
magick.AddProfile(ColorProfile.USWebCoatedSWOP);
See also https://magick.codeplex.com/wikipage?title=Convert%20image

- 1
- 1

- 36,764
- 19
- 160
- 190
-
The 'TransformColorSpace' method does the same as your example but has a better syntax. And if the source image has no profile it will use the one you supplied. Let me know on CodePlex if this doesn't work. – dlemstra Jul 22 '15 at 20:50
This has been answered here: .NET TIFF file: RGB to CMYK conversion possible without a third party library?
And I believe that answer came from the discussion here: http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/0a4fecba-6212-4e72-9e10-7874c6327e7a/
But that answer is limited to outputting in tiff format.

- 1
- 1

- 2,887
- 35
- 36