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
问题:
回答1:
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...
回答2:
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/
回答3:
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?
回答4:
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
The inverse of this, CMYK to RGB, is answered here.
回答5:
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.