Converting a PDF to the CMYK colour model

Tags: howtos, latex

Published on
« Previous post: Serving git repositories the smart way — Next post: Setting up an XMPP server with Prosody »

While preparing a conference paper submission, I initially struggled with converting my figures to the CMYK colour model. In my first attempt, I used ImageMagick to convert my figures manually, i.e. convert image.jpg -colorspace CMYK image_cmyk.jpg. I soon learned, however, that this does not always work. Namely, PNG files do not support this color model. Another problem was the conversion of SVG files created in Inkscape. While there is support for different colour models (using ICC colour profiles), the Inkscape version installed on my computer at work did not support this.

Before compiling Inkscape on my own, I luckily stumbled over the following Ghostscript magic:

gs -dSAFER -dBATCH -dNOPAUSE -dNOCACHE -sDEVICE=pdfwrite \
   -sColorConversionStrategy=CMYK -dProcessColorModel=/DeviceCMYK \
   -sOutputFile=output.pdf input.pdf

This converts colours to CMYK and resulted in a PDF that was deemed acceptable by the conference submission system. In my case, I did not have to tune any parameters, but a colleague (using the same approach) had some problems with image resolutions. If you are plagued by similar problems, I strongly suggest taking a look at the Ghostscript documentation for output devices.

Good luck and may the colours be ever in your favour!