Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RGB to CMYK and viceversa

0 views
Skip to first unread message

Marco De Toni

unread,
Mar 18, 1999, 3:00:00 AM3/18/99
to
Hi,
Does anybody tell me a more accurated way to convert CMYK to RGB and
viceversa (es. like Adobe Photoshop)
I used the the Inprise FAQ 879 formula.
Thanks
Marco

Steve Schafer (TeamB)

unread,
Mar 18, 1999, 3:00:00 AM3/18/99
to
On Thu, 18 Mar 1999 10:22:42 +0100, "Marco De Toni"
<m...@dedalomedia.it> wrote:

>Does anybody tell me a more accurated way to convert CMYK to RGB and
>viceversa (es. like Adobe Photoshop)

I'm going to assume that your RGB values range from 0 to 255, and your
CMYK values range from 0 to 100.

RGB -> CMYK

C := 100 - Round(100 * R / 255);
M := 100 - Round(100 * G / 255);
Y := 100 - Round(100 * B / 255);
K := C;
if M < K
then K := M;
if Y < K
then K := Y;
C := C - K;
M := M - K;
Y := Y - K;

CMYK -> RGB

R := 255 - Round(2.55 * (C + K));
if R < 0 then
R := 0;
G := 255 - Round(2.55 * (M + K));
if G < 0 then
G := 0;
B := 255 - Round(2.55 * (Y + K));
if B < 0 then
B := 0;

-Steve


Joe C. Hecht

unread,
Mar 18, 1999, 3:00:00 AM3/18/99
to
Marco De Toni wrote:
>
> Hi,

> Does anybody tell me a more accurated way to convert CMYK to RGB and
> viceversa (es. like Adobe Photoshop)
> I used the the Inprise FAQ 879 formula.
> Thanks
> Marco

I was unable to find FAQ 879, however I wrote the following
FAQ(s), and can assure you that they use the same standard
formulas used in commercail graphics packages.

http://www.borland.com/devsupport/delphi/qanda/FAQ2948D.html
http://www.borland.com/devsupport/delphi/qanda/FAQ2728D.html

Joe
--
Joe C. Hecht
http://home1.gte.net/joehecht/index.htm

Uberto Barbini

unread,
Mar 19, 1999, 3:00:00 AM3/19/99
to
Hi,
RGB -> CMYK conversion routine at borland are not quite right.
Adobe Photoshop use a very better algorithm which considers ink
charateristics.
For example Black RGB 0,0,0 is converted as CMYK 65,53,51,100 and not
0,0,0,100.
Anyway other apps use other system. Try with XPress or PageMaker.
You can try to find exact algorithm by yourself with select color dialog of
photoshop.


Bye Uberto
--

Uberto -- D&D Support Team

>>Does anybody tell me a more accurated way to convert CMYK to RGB and
>>viceversa (es. like Adobe Photoshop)
>

Joe C. Hecht

unread,
Mar 19, 1999, 3:00:00 AM3/19/99
to
Uberto Barbini wrote:
>
> Hi,
> RGB -> CMYK conversion routine at borland are not quite right.
> Adobe Photoshop use a very better algorithm which considers ink
> charateristics.
> For example Black RGB 0,0,0 is converted as CMYK 65,53,51,100 and not
> 0,0,0,100.

Sorry you did not like the FAQ I wrote. Actually, it is right
on the money. If you have to take the next step, then you
would be suffciently knowledgable about the subject as not
to even need the FAQ!

Of course, you can tell a "very better algorithm",
so I suppose you are familiar with the following
standard "end of the road" formula:

The following conversion formula uses UnderColorRemoval()
and BlackGeneration() functions that factor into the
conversions. Be aware that to properly use those functions,
you must actually know the charateristics of the inks you
are using, the paper your printing on, the type of printing
press or device, amounts of inc coverage, anticipated dot
gain, spread, trapping, tempature, humitiy, and so forth....

c := 1.0 - r;
m := 1.0 - g;
y := 1.0 - b;
k := min(c,m,y);
c := min(1.0, max(0.0, c - UCR(k)));
m := min(1.0, max(0.0, m - UCR(k)));
y := min(1.0, max(0.0, y - UCR(k)));
k := min(1.0, max(0.0, y - BG(k)));

Where UCR() is your UnderColorRemoval function
and BG() is your BlackGeneration function.

It just does not get any better than that, providing
you know enough about the device and what your printing
to make it work correctly.

Uberto Barbini

unread,
Mar 19, 1999, 3:00:00 AM3/19/99
to
>Sorry you did not like the FAQ I wrote. Actually, it is right
>on the money. If you have to take the next step, then you
>would be suffciently knowledgable about the subject as not
>to even need the FAQ!


I'm not here to criticize anybody. I've just puncted there are other algos
to covert RGB to CMYK, maybe it'll be better to put a hint on FAQ. ;-)
As you surely know there isn't a perfect CMYK (which is a reflected color
space) to RGB (transparent color space) conversion algorithm. Photoshop use
a decent standard. ;-)

Anyway thanks for your reply.

0 new messages