[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Groff] Re: CMYK <-> RGB
From: |
Keith Packard |
Subject: |
[Groff] Re: CMYK <-> RGB |
Date: |
Thu, 04 Oct 2001 23:06:15 -0700 |
Around 17 o'clock on Oct 4, Werner LEMBERG wrote:
> CMYK_ADOBE_COLORSPACE:
>
> r = (k*c)/maxval;
> g = (k*m)/maxval;
> b = (k*y)/maxval;
This one is clearly wrong -- CMYK is traditionally a subtractive space.
CMYK_NORMAL_COLORSPACE:
r = ((maxval-k)*(maxval-c))/maxval;
g = ((maxval-k)*(maxval-m))/maxval;
b = ((maxval-k)*(maxval-y))/maxval;
r = maxval - min(maxval, c*(maxval-k)/maxval + k);
g = maxval - min(maxval, m*(maxval-k)/maxval + k);
b = maxval - min(maxval, y*(maxval-k)/maxval + k);
These are the same. Proof:
(take maxval == 1, 0 <= c,m,y,k <= 1)
r = 1 - min (1, c * (1-k) + k)
Given 0 <= k <= 1, then for any Q <= 1:
Q * (1 - k) + k <= (1 - k) + k =1
thus
c * (1-k) + k <= 1
Hence:
r = 1 - (c * (1-k) + k)
r = 1 - (c - ck + k)
r = 1 - c + ck - k
r = (1 - c)(1 - k)
I see no conflict here, just bogus code in groff.
-keith
- [Groff] CMYK <-> RGB, Werner LEMBERG, 2001/10/05
- [Groff] Re: CMYK <-> RGB,
Keith Packard <=
- Re: [Groff] Re: CMYK <-> RGB, Ralph Corderoy, 2001/10/05
- Re: [Groff] Re: CMYK <-> RGB, Tadziu Hoffmann, 2001/10/05
- Re: [Groff] Re: CMYK <-> RGB, Keith Packard, 2001/10/05
- Re: [Groff] Re: CMYK <-> RGB, Larry Jones, 2001/10/05
- Re: [Groff] Re: CMYK <-> RGB, Ralph Corderoy, 2001/10/05
- Re: [Groff] Re: CMYK <-> RGB, Larry Jones, 2001/10/05
- Re: [Groff] Re: CMYK <-> RGB, Larry Jones, 2001/10/05
- [Groff] Re: CMYK <-> RGB, Werner LEMBERG, 2001/10/05
Re: [Groff] CMYK <-> RGB, Ralph Corderoy, 2001/10/05