Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any client-side technology able to convert sRGB to CMYK through an ICC color profile?

Is there any technology available in a browser (client-side) able to convert sRGB colors to CMYK and vice versa using a specified ICC color profile?

I'm currently using a hidden Java applet for the conversions (Java has a built-in class for this), but I'm trying to find an alternative, since java applets are slow and outdated.

SVG would be ideal if browsers supported ICC colors in SVG, but no-one does. Flash or Silverlight would also be good, but I can't find anything relevant.

like image 814
Lea Verou Avatar asked Jan 16 '11 19:01

Lea Verou


People also ask

What is an ICC scanner?

ICC (or ICM) profiles describe the color characteristics of scanners, printers, monitors etc. The profiles are used in a color management system to ensure that printed and / or viewed colors match the colors on the original scanned document.

What is an input profile?

What is an input profile? A. An input profile transforms colour from the colour spaces of an input device (a cameras or scanners) to the PCS. While they can be monochrome or n-component, the colour space is most often RGB.


2 Answers

Am I correct in thinking you want use the ICC profile of the display device?

I am fairly certain there is no facility to determine the display device ICC profile using javascript. At best it may be possible in a third party environment like Flash. The math itself would be no problem.

Of course, this is all really the responsibility of the web browser. Firefox has reasonably good support for colour management. If I'm not mistaken, Microsoft are going to be addressing colour management in IE9.

like image 186
Kevin A. Naudé Avatar answered Sep 30 '22 22:09

Kevin A. Naudé


After reading your question, I can't decide if:

a. you're trying to do a soft-proof operation, or

b. you're building a color picker type of app, and you want to provide your users with the names of certain colors (from e.g. pantone or NCS or somesuch) when you display their sRGB-value approximations, or

c. something else entirely.

What is the CMYK space you are concerned with? If you're doing option (a) -- soft proofing -- you can probably fit curves to the LUTs in the CMYK profile, and use them to figure out a 'shortcut' transform that you can then run in the non-ICC-aware javascript runtime you're working in. Most CMYK profiles do their conversion with LUTs, and many use ICC4 NamedColor2 values (which you may know as the value in 'ncl2' ICC tags).

If this is the case, I can point you to some resources on how to do that -- I am doing it myself using SciPy in the python django color-management image-analysis app platform thing I am working on.

If you're doing option (b), and you need color names, you can extract the names you need from your CMYK profile (most likely NamedColor2 values) and build a lookup table, which you can then serialize it to JSON so you can load it in your app. If your app needs to have some knowledge of the display space, you can probably have the user 'calibrate' your app for their display -- feed them some questions that will allow you to calculate the white-point offset (and possibly the RGB XYZ tristimulii) and then maybe create a quickie transform (which could be as simple as one chromatic adaptation transform I am guessing) which you then apply to color values you want to 'color manage' before you display them.

To do the transforms without a CMS system, Bruce Lindbloom's math is a good place to start:

http://www.brucelindbloom.com/

if it's c) I am very curious as to what it is.

is any of that helpful? I can elaborate and/or provide example code, &c, if you supplement your question (I'm doing work in a similar problem-domain, so we could both win on this).

like image 24
fish2000 Avatar answered Sep 30 '22 21:09

fish2000