2

I saw the accepted answer to this question: Script (or some other means) to convert RGB to CMYK in PDF?

...and it mentioned the ICC profile capability of GhostScript 9, and the ability of GhostScript to re-distill a PDF without "re-frying".

This sounds like it might be the solution I've been looking for in my quest to find a way of processing a PDF file to replace a single RGB colour with a specific CMYK value.

Note: I don't want to perform an automated mapping of colours - I want to control which colours get mapped to which other colours (there are only a few colours used).

Trouble is, I know zilch about ICC profiles, and the GhostScript site doesn't actually seem to have any tutorials or information other than details of the command line options.

So: would this ICC profile capability let me define specific RGB colours to be replaced, with specific CMYK relplacements? If so, how do you go about that? Any tutorials out there?

Community
  • 1
  • 1
Gary McGill
  • 26,400
  • 25
  • 118
  • 202

1 Answers1

2

First; you are mistaken that Ghostscript does not 're-fry' the PDF, it most certainly does. The incoming PDF is fully interpreted, converted to a series of graphics primitives and sent to the destination device. If the device is pdfwrite then these are re-assembled into a brand-new PDF file.

What it does not do is convert it to PostScript, but that's not quite the same thing.

As for your actual question; no you can't currently do this, and its unlikely you will be able to do so. For starters pdfwrite normally preserves all colours, it doesn't convert them. If specifically requested it does some conversions, but it doesn't use the ICC profile to do so at the moment, it uses the PostScript defined method for conversion to a specific device space.

When we move on to do the conversion using ICC profiles then you will be able to specify profiles to do the conversion, and in this case you will indeed be able to control the conversion. To do this you will need to understand ICC profiles quite thoroughly, and this is well beyond the scope of an answer here. There are books on the subject of colour and these generally include information on ICC profiles.

To be honest, you would probably be a lot better off simply modifying the Ghostscript pdfwrite device to do what you want.

KenS
  • 30,202
  • 3
  • 34
  • 51
  • "no you can't currently do this" -- that's all I needed to know, thanks – Gary McGill Nov 14 '11 at 14:04
  • Did you ever find a way of doing this? As I understand it, Ghostscript 9 supports ICC profiles, making this possible, but I can't work how to set up an ICC profile that does this. – tomtaylor May 14 '12 at 18:06
  • As I said in my answer, the pdfwrite device doesn't use the ICC profiles currently, it does its own colour management. So you still can't do this with pdfwrite. It is intended that this will change, but there is no schedule yet. – KenS May 15 '12 at 07:04
  • @KenS: The term 're-fry' is frequently used in prepress pro circles to describe a roundtrip *PDF->PostScript->PDF*. The statement about Ghostscript not doing this type of 're-fry' probably can be traced back to me. Ghostscript does *PDF->graphic_primitives->PDF* (as you did indeed describe+confirm) which for me certainly isn't 're-fry'. I'd be glad if we could both agree to ***NOT*** declare *'Ghostscript most certainly does re-fry.'*, but instead use a different term for what Ghostscript does... – Kurt Pfeifle Oct 10 '12 at 20:01
  • The term re-fry to me means simply to convert into some other format and back, a round trip conversion yes, but not via PostScript. I've been using it that way, and to the best of my knowledge so have others, for quite a few years. You want to confine the term refry specifically to mean a conversion into PostScript, I want it to stay general. – KenS Oct 11 '12 at 08:54