Tuesday, November 25, 2008

SVG Chicken and the CMYK Egg

For some time now SVG has suffered from a fair bit of chicken-and-egg problem when it comes to CMYK. Not much of the software out there handling SVG supports CMYK because not too many people use SVG for CMYK work. And not too many people use SVG for CMYK work because not much software supports it. Unfortunately this cycle has persisted for quite some time.

CMYK for vector work mainly matters to a segment of the users out there who are preparing artwork for printing. Some doing print work might find wide gamut RGB to be a better solution (photographic work, for example), since it is rare that an artist is actually working in the exact CMYK output colorspace for the specific printer that will be used for the final output. But still there are those who find the lack of CMYK as a blocking issue. There is also a factor that the types of artwork that can benefit more from working directly in CMYK are more the non-photographic types that are less appropriate to work on in GIMP or Photoshop.

Since the beginning, Inkscape has allowed users to select colors using CMYK values, but those were not truly selecting CMYK. Instead it would use a simplistic approach to split RGB into some sort of CMYK numbers (but not profile-matched accurate ones), and then convert the user's selection back into RGB numbers for storage in the SVG. So although there was a CMYK color picker, Inkscape did not really "handle CMYK."

Starting with version 0.46, however, work has started that will begin to break the negative cycle of lack of CMYK support both in Inkscape and in other software. Leveraging the icc-color support in the SVG 1.1 spec, it is possible to use a CMYK color profile to store and work with proper CMYK values. Although no UI was added to allow a simple means to reference an ICC profile, once a SVG file that contains a reference to an ICC profile is opened, a new "CMS" color picker is enabled that can be used to choose colors using accurate values in proper CMYK.

What this does is allow for initial work with proper CMYK to be started. Users who are aware can start creating files with CMYK values with just a little manual tweaking. More importantly, however, is that people working on other programs can now start getting CMYK SVG files that are standard-compliant and thus can start adding support on their side. One such project is Scribus, who's developers have been coordinating with the Inkscape team, and who are looking at supporting such ICC profile SVG files in their next version.

That still leaves Inkscape with several areas to work on, but these are mainly independent now that the core work is in, and can be attacked independently of each other:

  • Add a basic UI for linking to ICC Profile files.
  • Integrate ICC profile support into the existing color selectors, including out-of-gamut selection warning.
  • Scan existing codebase for areas that limit themselves to RGB or RGBA values and thus can strip out full icc colors.
  • Improved style and/or CSS support to manage paint types, palettes, etc.
  • Basic support for "registration" color/style.
  • Coordinate with Cairo team on extending API beyond RGB
  • CMYK PDF export

5 comments:

Guillermo said...

Thanks heaps, Jon!
True CMYK will be a great help for graphic designers, who need to have control over the channels and pure black/grey.
True CMYK + CMYK PDF export will make my life easier and happier :-).

Demian said...

That's great news!

IIRC, Adobe apps use CIE Lab internally and then convert to smaller gamut spaces like RGB and CMYK. So Inkscape's approach was not bad at all! :-D

Jon A. Cruz said...

Well... Inkscape's early behavior was not comparable to Adobe's use of CIE Lab. Actually Inkscape did that, but used 24-bit sRGB internally (aka it used the smaller gamut internally, right after one typed in values specified in the better colorspace)

=-O

nitrofurano said...

icc helps a little bit, but not enough - try to have, from rgb inkscape document: the following cmyk colours (values from 0 to 100): 100,0,0,0 ; 0,100,0,0 ; 0,0,100,0 ; 100,100,100,100 ; 0,0,0,100 - you can't - from cmyk, you see differences between gcr and ucr colours, from rgb you can't - and when you edit a rgb document, the colours 100,100,100,100 and 0,0,0,100 seems to be the same, when they aren't - that's why both inkscape and svg needs a true cmyk support.

matthis said...

That is a very interesting article and I would like to manualy add a link to a CMYK ICC color profile in some svg files, so I opened a svg file with Notepad++ but I have no idea what a correct link to a profile would look like.
Could you post an example? Tha twould be great