使用ICC配置文件将RGB转换为CMYK [英] Converting RGB to CMYK , Using ICC Profile

查看:1056
本文介绍了使用ICC配置文件将RGB转换为CMYK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我打算将RGB颜色转换为CMYK以进行打印. 此转换的规模是Adobe Photoshop ( Image -> Mode -> CMYK color )

我尝试了2个解决方案,但没有一个返回正确的值:

解决方案1-使用.NET Framework

首先,我遵循以下步骤

  • Adob​​e

  • 转换#color MSDN

  • string convretedColor = string.Format("#{0:X2}{1:X2}{2:X2}", _color.R, _color.G, _color.B)

结果如下:

  • 个人资料:CoatedFOGRA27.icc

  • 原始颜色:#2f00ff

  • 已转换的颜色:#3b4996

  • 使用Adobe Photoshop(相同的配置文件)的转换结果:#3b4996 甚至没有关闭!

解决方案2-使用Windows颜色系统(WCS)

我还通过相同的步骤尝试了 Codo的解决方案

结果如下:

  • 配置文件:CoatedFOGRA27.icc

  • 原始颜色:#2f00ff

  • 已转换的颜色:#2032FF

  • Photoshop:#3b4996

用于比较的JSFiddle

编辑

根据科多的评论,我认为我在理解色彩概念方面存在一些基本问题! (如果我错了,请纠正我)

对于任何颜色,我们都有不同的颜色模型,RGBCMYK,...

RGB显示(Red Green Blue)生成颜色和CMYK(Cyan Magenta Yellow *)的组合.这些模型的值可以轻松地彼此转换.

例如:

  • RGB十六进制:#2F00FF

  • RGB:47 - 0 - 255

  • CMYK:0,816 - 1,000 - 0,000 - 0,000

几乎所有监视器都使用RGB来显示颜色.打印的颜色(由于使用墨水而不是LED o ...)与您在监视器/

上看到的颜色完全不同

对于此问题,Photoshop之类的图像编辑器使用CMYK **MODE**.在此模式下,如果选择RGB颜色,则编辑器会将其转换为打印后看到的颜色并将其显示在屏幕上.取决于颜色配置文件(此处为ICC)

编辑2

解决方案

让我尝试帮助您解决所有问题:

1)RGB是一种描述颜色值的格式.即:红色为255,0,0.

2)HSV是描述颜色值的另一种格式.即:红色为0,100,100

只有这两个可以为您提供数字精确的颜色
您可以将它们视为颜色的数字表示形式或真实的DNA,并感谢上帝,监视器能够呈现它们-正是它们的本质.

让我们继续前进:

3)Lab是描述颜色值的另一种格式.

红色RGB为54,81,70,即(255,0,0)..
54,81,70也可以应用于其他RGB..(254,0,0)

那是为什么?因为实验室格式旨在逼近人类视觉.
对于人眼来说(255,0,0)和(254,0,0)之间没有区别
嗯..对于人眼来说不是很准确..
更准确地说是用来获得想要的Lab颜色的模型.

4)CYMK旨在告诉打印机将青色,黄色和洋红色混合到纸上的压力是多少,而将K(键或黑色)混合到纸上的颜色要多少.

所以0%,100%,100%,0%会给我们红色的混合物.
而0%,50%,50%,0%会给我们粉红色.

让我们继续前进:

您的工作是将显示器中显示的RGB调整为打印机的CMYK.
上帝知道为什么当它是全自动的并且由驾驶员操纵多年后,您为什么要这样做..
但是我想你有你的理由,所以让我们继续,
每台打印机的CMYK值都略有不同,可以混合以达到特定的红色.

这是ICC配置文件开始起作用的地方.
他们通过提供(1)原始RGB-RED的表格来提供RED的标准 和(2)特定打印机中的CMYK红色.

因此,根据ICC配置文件将RGB(红色)转换为CMYK(红色)是合乎逻辑的.

但是,如果您尝试转换回去-您会注意到,根据特定配置文件,用于RED的CMYK可以具有多个数字RED值.

这是因为数字色彩分辨率比结果要精确得多. 打印纸,另一种查看方式是说特定的打印机ICC可以在Lab上构建.

现在我知道..我知道..您可能已经知道了大部分(如果不是全部).
(我写这只是为了确保我们都在书的同一页上.)

因此,当您说没有一个返回正确的值"时 (假设它们=转化)您是什么意思? 一切对我来说都是正确的,因为实际上,它们确实返回了正确的值-用于打印目的.

I'm about to converting RGB color to CMYK for printing purpose. scale of this conversion is Adobe Photoshop ( Image -> Mode -> CMYK color )

I tried 2 solution , but none of them return the right value :

Solution 1 - Using .NET Framework

At first , I followed by these steps

  • Download ICC profiles (windows version) from Adobe

  • Convert the #color to CMYK

  • used System.Windows.Media.Color.FromValues // return Color MSDN

  • string convretedColor = string.Format("#{0:X2}{1:X2}{2:X2}", _color.R, _color.G, _color.B)

here is the result :

  • profile : CoatedFOGRA27.icc

  • Original Color : #2f00ff

  • Converted Color : #3b4996

  • Result of conversion With Adobe Photoshop (same profile) : #3b4996 not even close!

Solution 2 - Using Windows Color System ( WCS )

I also tried the Codo's solution with same procedure

here is the result :

  • Profile : CoatedFOGRA27.icc

  • Original Color : #2f00ff

  • Converted Color : #2032FF

  • Photoshop : #3b4996

JSFiddle for compare

EDIT

According to Codo's Comments, I think, I have some fundamental problems of understanding colors concept !! ( please correct me if I'm wrong )

For any color, we have different color models , RGB , CMYK, ...

RGB shows the combination of (Red Green Blue) to generate color and CMYK as well (Cyan Magenta Yellow * ). the values of these models can easily convert to each-other.

for example :

  • RGB HEX : #2F00FF

  • RGB : 47 - 0 - 255

  • CMYK : 0,816 - 1,000 - 0,000 - 0,000

Almost, all monitors use RGB to shows the colors.the printed color (because of using Ink instead of LED o ...) is totally different from the color that you see on monitor/

For this issue, Image Editors like Photoshop use CMYK **MODE**.In this mode , if you select the RGB color, the editor convert it to color that you see after printing and shows that to screen.this conversion is absolutely depend on color Profiles ( here ICC )

EDIT 2

解决方案

Let me try to help you sort it all out:

1) RGB is a format to describe a color value. i.e.: 255,0,0 for red.

2) HSV is another format to describe a color value. i.e.: 0,100,100 for red

Those two are the only ones that will give you the digitally accurate color,
you can think of them as digital representation of the color or it's real DNA and thanks god the monitor is able to present them - exactly for what they are.

Let's move on:

3) Lab is another format to describe a color value.

54,81,70 for red RGB which is (255,0,0) however..
54,81,70 can also apply to a different RGB.. (254,0,0)

why is that? because Lab format is designed to approximate human vision.
and for the human eye there is no difference between (255,0,0) and (254,0,0)
well.. not really accurate to say that for the human eye..
more accurate to say the model which is being used to get the Lab color which intends to..

4) CYMK is designed to tell the printer what mixes of Cyan, Yellow and Magenta to press to the paper and K (key or black) for how much dark to press into that mix.

So 0%,100%,100%,0% will give us the mixture for red..
and 0%,50%,50%,0% will give us pink.

Let's move on:

Your effort is to adjust the RGB which seen in the monitor to the CMYK of the printer.
God knows why you want to do that when it's been fully automatic and handled by the driver for years..
But I assume you have your reasons, So let's continue,
Each printer has a slightly different CMYK values to mix to get to that specific red..

And this is where ICC profiles come into action..
They give a standard for RED in example by providing table for (1) the original RGB-RED and (2) the CMYK red in a specific printer.

So converting from RGB(Red) to CMYK(red) according to an ICC profile is logical to wish for.

But if you try to convert back - you will notice that the CMYK for RED according to a specific profile can have multiple digital RED values..

This is because the digital color resolution is much more accurate than what comes out to a printed paper, another way to look at it is to say that a specific printer ICC could have been built upon Lab.

Now I know.. I know.. you probably already knew most of if not all of it.
(I wrote it just to be sure we both on same page in the book.)

So, when you say "none of them return the right value" (Assuming them = the conversions) what exactly do you mean?! All seems right to me, as In fact they do return the right value - for printing purposes.

这篇关于使用ICC配置文件将RGB转换为CMYK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆