我想在C#中使用.icc配置文件“ISOnewper26v4.icc”!但我现在有个问题..我不知道如何使用此ICC配置文件将CMYK颜色转换为Lab值或将RGB转换为Lab值??!!如何分配配置文件??
发布于 2013-02-09 17:21:51
据我所知,C#和相关的库不包含任何用于将CMYK或RGB转换为Lab的函数。contain函数用于将CMYK转换为RGB (请参阅此answer)。
Windows API似乎具有在不同颜色系统之间进行转换的功能。它至少适用于将RGB转换为CMYK (参见此answer)。
您可能需要以下扩展:
[StructLayout(LayoutKind.Sequential)]
public struct LabCOLOR
{
public ushort L;
public ushort a;
public ushort b;
public ushort pad;
};
[DllImport("mscms.dll", SetLastError = true, CallingConvention = CallingConvention.Winapi)]
static extern bool TranslateColors(
IntPtr hColorTransform,
[MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2), In] RGBColor[] inputColors,
uint nColors,
ColorType ctInput,
[MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2), Out] LABColor[] outputColors,
ColorType ctOutput);然后,您应该能够将"cmyk“替换为" Lab”,以将RGB颜色转换为Lab颜色。不过我还没试过。
发布于 2014-07-17 22:06:33
在实验室空间ICC配置文件的帮助下,应该可以“转换”到CIE Lab。爱克发曾经有过一台。否则,必须编写一个例程在ICM之外通过A2B0标记为输出配置文件手动进行转换。当心,这个ISOnewspaperv4配置文件是不靠谱的。
https://stackoverflow.com/questions/14750493
复制相似问题