Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Colorizing and blending separations for printing PDFs in Ghostscript

I'm using Ghostscript to produce grayscale tif separations for every Process and Spot color in a PDF file. The process looks like this:

  1. Ghostscript is run with tiffsep as the device
  2. I use ImageMagick with the grayscale separation file as a mask to colorize on a white canvas using colors extracted from the PDF file

But the colorized separations are different than in Adobe's Print Preview.

I tried using ICC color profiles from Adobe (namely AdobeRGB1998 and USWebCoatedSWOP for CMYK) in both ImageMagick and Ghostscript, but the results are still off.

Ghostscript version: 9.14, IM: 6.8.9-5

like image 862
farnoy Avatar asked Jul 10 '14 14:07

farnoy


1 Answers

I do not really get your statement "colorized separations are different than in Adobe's Print Preview." --- What do you compare Adobe's Print Preview with?!? Are you aware that Adobe's Print Preview might apply a builtin default ICC profile if and when the PDF itself does not contain one. This alone can explain any difference you may be "seeing"...

Also, ImageMagick recently has seen some quite important changes in recent versions when it comes to color management: it has swapped the meanings of -colorspace RGB (which now means non-linear color) and -colorspace sRGB (which now means linear color) -- while before this change it was the other way round. See here for more details about these changes.


Did you consult the official documentation about Ghostscript's color management capabilities? Its newest version is available here:

  • http://git.ghostscript.com/?p=ghostpdl.git;a=blob_plain;f=gs/doc/GS9_Color_Management.pdf;hb=HEAD

In any case, before you will be able to achieve any meaningful and reliable results handling colors, you need to calibrate all your devices in your workflow (monitors, printers, scanners, cameras) -- or at least verify their calibration. Also note, these calibrations are only valid for an environment with a standard illuminating light (such as D50 or D65). This is essential in order to let your eyes really recognise color differences or color matches.

Also, have you checked your PDF file does not use its own internal, embedded ICC profile(s)? In this case you might need to add

-dOverrideICC=true

to force Ghostscript to apply the ICC profiles you supply on the command line.

To make Ghostscript use ICC profiles supplied by you, add these parameters to your commands:

-sOutputICCProfile=/path/to/your/profile.icc

For the tiffsep output device, you could also use an N-Color (NCLR) ICC profile and specify the names of the colors in the profile, like (for example)

-sICCOutputColors="Cyan, Magenta, Yellow, Black, Orange, Violet"

When using device link profiles, you should use

-sDeviceLinkProfile = /path/to/your/devicelinkprofile.icc

There is a LOT more to be learned about Ghostscript and color management...

But since you did not give us any idea about the exact commands you used, nor a sample of your PDF files, nor a precise description of your problem, there is not much more that can be advised with confidence here.

like image 51
Kurt Pfeifle Avatar answered Oct 04 '22 12:10

Kurt Pfeifle