comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Postscript Color RGB to CMYK
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Postscript Color RGB to CMYK [message #35669] Thu, 03 July 2003 04:16
George White is currently offline  George White
Messages: 10
Registered: November 1998
Junior Member
On Tue, 1 Jul 2003, Esa Riihonen wrote:

> Hi all!
>
> I wonder whether someone might have bumped on this problem before and
> even perhaps have somekind of solution.
>
> As I understand, Postscript files produced by IDL have color coded as
> RGB. However several (propably most) journals require CMYK-code. I have
> a clumsy solution, load the file in CorelDraw and make the changes there
> - this is far from perfect as it among other things usually require many
> trials e.g., going back to IDL for changing the line thicknesses and such.
>
> So has anyone a better solution?

I find Adobe tools (Illustrator and Photoshop) do a better job of the
RGB->CMYK conversion. I've tried doing conversions using the textbook
formulas, but often the colors come out looking "muddy" and don't come out
as well in print. I suspect the problem is that many of our images use
colors that are outside the printer gamut. The same RGB LUT will produce
different images on different CRT's (e.g., PC vs Mac or SGI due to the
different gamma values used on these systems). See, e.g.,
http://www.fcaglp.unlp.edu.ar/~esuarez/gmt/1998/0651.html for more on this
issue.

In principle, using a PS interpreter such as ghostscript you can rewrite a
PS file to replace RGB colors with CMYK. Jason Olszewski's aimaker script
does a number of color manipulations (using awk scripts) after converting
the PS file to AI format (so the operators have a consistent form), but
doesn't deal with images.

There are other issues in creating pre-press files (color separation,
trapping, gamut mapping). The IDL display devices are RGB, and doing CMYK
properly seems to require more than just the textbook formula. We often
create reports with images processed using multiple tools (IDL, GMT,
matlab). All of these support RGB LUT's so you can preserve consistent
color scales across the packages. These LUT's are tuned for CRT's, and
have become the "norm" for viewing certain data sets.

RGB to CMYK conversion seems to be a "hard" problem. Does it make sense
to try to solve this in IDL or is it better to look for a more universal
tool that will give consistent results for PS from multiple sources?

--
George White <aa056@chebucto.ns.ca>
Head of St. Margarets Bay, Nova Scotia
Re: Postscript Color RGB to CMYK [message #35670 is a reply to message #35669] Thu, 03 July 2003 04:04 Go to previous message
Esa Riihonen is currently offline  Esa Riihonen
Messages: 6
Registered: July 2003
Junior Member
On Tue, 01 Jul 2003 21:29:57 +0300, Meta Sienkiewicz wrote:

[snip]

: Someone at my office had asked me the same question about a month ago.
: He figured a way to handle this by editing the PS file by hand - but I
: later found a Perl script that may be able to do this automatically. The
: web page for the script is
:
: http://dionysos.mpch-mainz.mpg.de/~joeckel/pscol/
:
: It will also do PS color to grayscale conversion.
:
: The script needs a standardized PS file for input, created via
: Ghostscript 'ps2ps' or 'eps2eps'. It uses a simple algorithm for the
: conversion and probably will work ok for simple color conversions - like
: the colored line plots my colleague was producing. For other cases you'd
: need to load the figure in Photoshop, or CorelDraw as Esa noted above. I
: suppose one could modify the script to deal with IDL PS format directly
: and take out the 'ps2ps' step... At least it may be useful until IDL can
: generate CMYK PS.

Thanks Meta, I will give it a try.

Meanwhile a collegue found a similar solution by Fred Clare based on an
'ed'-script:

http://ngwww.ucar.edu/ncarg-talk/all/0414.html

To ease the usage I made a small IDL-procedure around it which seems to
work fine for my current needs. However as I have a very simple color
plots with most six different colors. I'm pretty sure this can't be the
final solution, otherwise it would have been implemented already ages ago.


All the best and thanks again,

EsaR
Re: Postscript Color RGB to CMYK [message #35671 is a reply to message #35670] Thu, 03 July 2003 03:53 Go to previous message
Esa Riihonen is currently offline  Esa Riihonen
Messages: 6
Registered: July 2003
Junior Member
On Tue, 01 Jul 2003 15:59:16 +0300, Reimar Bauer wrote:

> Esa Riihonen wrote:

[snip]

>> PS. I think provision of CMYK-coded PS would be much needed in the
>> future IDL-versions.
>
>
> I have already done a feature request it got's a high priority. Please
> do the same.

Will do!

Cheers,

EsaR
Re: Postscript Color RGB to CMYK [message #35686 is a reply to message #35671] Tue, 01 July 2003 11:29 Go to previous message
msienkiewicz is currently offline  msienkiewicz
Messages: 8
Registered: October 2000
Junior Member
Esa Riihonen <riihonen@NO.SPAM.utu.fi> wrote in message news:<3F017E9D.8040302@NO.SPAM.utu.fi>...
> Hi all!
>
> I wonder whether someone might have bumped on this problem before and
> even perhaps have somekind of solution.
>
> As I understand, Postscript files produced by IDL have color coded as
> RGB. However several (propably most) journals require CMYK-code. I have
> a clumsy solution, load the file in CorelDraw and make the changes there
> - this is far from perfect as it among other things usually require many
> trials e.g., going back to IDL for changing the line thicknesses and such.
>
> So has anyone a better solution?
>
> Our IDL environment is 'IDL Version 5.6, Compaq Tru64 (OSF alpha m64)'
> Also Linux and even Windows based solutions would be OK.
>
>
> Cheers,
>
> EsaR
>
> PS. I think provision of CMYK-coded PS would be much needed in the
> future IDL-versions.


Someone at my office had asked me the same question about a month ago.
He figured a way to handle this by editing the PS file by hand -
but I later found a Perl script that may be able to do this
automatically. The web page for the script is

http://dionysos.mpch-mainz.mpg.de/~joeckel/pscol/

It will also do PS color to grayscale conversion.

The script needs a standardized PS file for input, created via
Ghostscript 'ps2ps' or 'eps2eps'. It uses a simple algorithm
for the conversion and probably will work ok for simple color
conversions - like the colored line plots my colleague was producing.
For other cases you'd need to load the figure in Photoshop, or CorelDraw
as Esa noted above. I suppose one could modify the script to deal
with IDL PS format directly and take out the 'ps2ps' step...
At least it may be useful until IDL can generate CMYK PS.
Re: Postscript Color RGB to CMYK [message #35701 is a reply to message #35686] Tue, 01 July 2003 05:59 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Esa Riihonen wrote:
> Hi all!
>
> I wonder whether someone might have bumped on this problem before and
> even perhaps have somekind of solution.
>
> As I understand, Postscript files produced by IDL have color coded as
> RGB. However several (propably most) journals require CMYK-code. I have
> a clumsy solution, load the file in CorelDraw and make the changes there
> - this is far from perfect as it among other things usually require many
> trials e.g., going back to IDL for changing the line thicknesses and such.
>
> So has anyone a better solution?
>
> Our IDL environment is 'IDL Version 5.6, Compaq Tru64 (OSF alpha m64)'
> Also Linux and even Windows based solutions would be OK.
>
>
> Cheers,
>
> EsaR
>
> PS. I think provision of CMYK-coded PS would be much needed in the
> future IDL-versions.


I have already done a feature request it got's a high priority.
Please do the same.



best regards

Reimar



--
Reimar Bauer

Institut fuer Stratosphaerische Chemie (ICG-I)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
------------------------------------------------------------ -------
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
============================================================ =======
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Problems of IDL search path and runtime source file compilation or saved routines restoration.
Next Topic: usergroup in germany /in german lang./

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 01:05:48 PDT 2025

Total time taken to generate the page: 0.87931 seconds