CMYK 2 RGB 问题
我在将 CMYK 颜色转换为 RGB 时遇到问题。 在互联网上有很多公式可以转换它,但例如当我将 CMYK (0,100,100,0) 转换为 RGB 时,它得到的值是 (255 0 0),但在 Adobe Photoshop 中 RGB 值是 (237,28,36),我想要这个。有人知道如何用java或.NET转换它吗?
I have a problem with converting a CMYK Color to RGB.
In the internet there is many formulas to convert it but for example when I convert CMYK (0,100,100,0) to RGB, it get value (255 0 0) but in Adobe Photoshop RGB value is (237,28,36) and I want this one. Is anybody know how to convert it with java or .NET?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
还有其他问题提出同样的问题:
您的问题的一般要点是 Photoshop 正在应用颜色配置文件中您只是进行直接转换。请参阅我对其他一些问题的回答,因为我觉得我已经回答了这个问题。
There are other questions asking the same thing:
The general gist of your problem is that Photoshop is applying a Color Profile where-as you are simply doing a direct conversion. Please see my answers to some of the other questions as I feel like I've answered this question to death.
如果您想要好的结果,您需要应用颜色配置文件。在 .NET 中,您可以这样做(假设原始 CMYK 分量在 0 到 255 之间的范围内):
请注意,使用了来自两个不同命名空间的两个不同的 Color 类。您可能需要添加 PresentationCore DLL 作为参考。
所需的颜色配置文件可以从 eci.org 的下载部分下载。它是包含多个配置文件的更大 ZIP 文件的一部分。他们明确建议使用 ISO Coated v2 300% (ECI) 配置文件。
有一个不错的网站,展示了 CMYK 到 RGB 颜色转换以及工作中的颜色配置文件。
如果您需要将完整图像从 CMYK 转换为 RGB,则同一命名空间中有专门的类。
If you want good result, you need to apply a color profile. In .NET, you can do it like that (assuming the the original CMYK components are in the range between 0 and 255):
Note that two different Color classes from two different namespaces are used. And you probably need to add the PresentationCore DLL as a reference.
The required color profile can be downloaded from the downloads section of eci.org. It's part of a bigger ZIP file containing several profiles. They explicitly recommend to use the ISO Coated v2 300% (ECI) profile.
There's a nice web site showing the CMYK to RGB color conversion with the color profile at work.
If you need to convert a complete image from CMYK to RGB, there are special classes for this in the same namespace.
如果你想要像 Photoshop 这样的 cmyk 转换,那么使用 JDeli java 图像库;有一个名为 EnumeratedSpace 的类可以为您完成这项工作;
请不要忘记位掩码,因为返回值是 rgb 字节
if you want photoshop like cmyk conversion then use JDeli java image library ; there is a class called EnumeratedSpace which does the job for you;
please do not forget to bit mask because return values are rgb bytes
ColorJizz 可以将 RGB 转换为 CMYK 和许多其他格式。那里有一个.NET 版本。
ColorJizz can convert from RGB to CMYK and many other formats. There's a .NET version in there.