22

Is it possible to specify that as SVG image should produce output in CMYK? If so, is it a big task? What if the image has its colours specified in RGB, is it difficult to convert them to CMYK?

DaveDev
  • 41,155
  • 72
  • 223
  • 385
  • 1
    Presumably, you were trying to prepare generated SVG for print? See also: [Is there any design software that can read, import or convert CMYK SVG?](http://graphicdesign.stackexchange.com/questions/18714/) which includes some info on how to turn CMYK SVG files into something that design and print software can understand. – user56reinstatemonica8 Jun 11 '13 at 16:19

2 Answers2

17

SVG supports ICC colors, using ICC color profiles, which would let you do what you need, but it's not yet supported by any browser :(

Lea Verou
  • 23,618
  • 9
  • 46
  • 48
12

SVG 2.0 adds support for unmanaged colors allowing you to specify a CMYK color with an sRGB fallback:

<circle fill="#CD853F device-cmyk(0.11, 0.48, 0.83, 0.00)"/>

You can also use icc-named-color() to specify a spot color which would be defined in a linked ICC color profile.

At this time, this is still a working draft spec, but some tools may support it such as Apache Batik's svgcolor12 branch.

jon_wu
  • 1,113
  • 11
  • 26
  • Do you have any advice on building the svgcolor12 branch? I went through the process described on the [mailing list](https://www.mail-archive.com/batik-dev@xmlgraphics.apache.org/msg03215.html) (from a comment of yours elsewhere) and ended up with a slew of errors on missing symbol ColorProfileUtil when building FOP. – Pete Schlette Jun 04 '14 at 22:25
  • I forget where the post was but I think the key was building the batik-all jar. There's some task to build everything into a single jar instead of individual ones and that one works. That same post said that there were issues with the other build tasks. – jon_wu Jun 05 '14 at 02:44
  • Took a lot of fiddling but I've got it sorted out now - thanks! I think the key is to move the batik-all.jar into FOP's `/lib` (as you said) but *not* to move the `xmlgraphics/common` output into FOP's `/lib` (contrary to the post on the mailing list). The result is that using device-cmyk in SVG gets translated into a CMYK color in the output PDF. – Pete Schlette Jun 05 '14 at 18:43