将RGB格式的PDF转换为CMYK格式的PDF

4

我正在寻找一种将RGB颜色的PDF转换为CMYK颜色的方法。我已经尝试过不同的程序,比如Ghostscript和PStill,但都没有得到满意的结果。是否有人知道一种可以100%正常运行并能通过命令行运行的方法?


你最近有发现什么吗?(差不多已经五年了^^) - J'hack le lezard
1个回答

1

可以使用Ghostscript实现,但需要使用来自argyllcollink工具帮助准备转换(DeviceLink) ICC配置文件,以定义如何正确地将特定RGB转换为特定CMYK配置文件。

  1. Get the RGB input ICC profile your documents have, such as some basic sRGB icc file, if the original is supposed to be in sRGB. (If it's AdobeRGB use AdobeRGB input ICC etc.)

  2. Get the CMYK output ICC profile you would like documents convert to, for modern European offset printers nowadays a reasonable choice would be eciCMYK v2 which is a "CMYK exchange color space profile". (Also called FOGRA 59).

  3. Install collink tool from argyll package.

  4. Let collink create DeviceLink profile to calculate how to properly convert RGB to the particular CMYK. If you use "-f" parameter it will do an exception for neutral, grey and black color so they are not as rich CMYK black but a plain K black. It is expected to have both icc profiles in the working folder). Details in documentation at https://www.argyllcms.com/doc/collink.html saying for the -f parameter "Force neutral colors to be K only output."

    collink -v -f sRGB.icm eciCMYK_v2.icc sRGB_to_eciCMYK_v2.icc
    

    The result is a DeviceLink icc file sRGB_to_eciCMYK_v2.icc.

  5. Then create a control-sRGB.txt file to tell ghostscript parameters which devicelink profile to use for which and with which type of intent. You can do collink twice, make two profiles one for images to not put blacks to plain black but keep the blacks rich, and then another for text and graphics to force black content be purely from the black (K) ink plate. Note the separator between parameters in control file must be tabs, not spaces. Example:

    Image_RGB   sRGB_to_eciCMYK_v2.icc  0   1   0
    Graphic_RGB sRGB_to_eciCMYK_v2.icc  0   1   0
    Text_RGB    sRGB_to_eciCMYK_v2.icc  0   1   0
    
  6. Finally run Ghostscript this way, where 1-input-rgb.pdf is the input PDF in RGB, and 2-output-cmyk-from-sRGB.pdf is the output CMYK PDF:

    gs -o 2-output-cmyk-from-sRGB.pdf \
        -sDEVICE=pdfwrite \
        -sColorConversionStrategy=CMYK \
        -sSourceObjectICC=control-sRGB.txt \
        1-input-rgb.pdf
    
如果您拥有许可证,可以在Adobe Acrobat Pro中测试结果,或者使用开源软件Scribus(编辑菜单-颜色,见下面的截图)查看所有使用的颜色是否为CMYK,并且使用collink的-f设置,黑色或灰色是纯黑而不是深黑。

注意: 不要依赖于Imagemagick识别命令等,它不能可靠地告诉您所得到的PDF中的所有对象是否为CMYK,它实际上仍然会写入RGB,这实际上并不正确。

图片:

来自Scribus 1.5.8的屏幕截图,显示了原始RGB PDF和上述转换后的CMYK PDF


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接