[GRASS-dev] r.what.color questions
Glynn Clements
glynn at gclements.plus.com
Thu May 10 06:19:14 EDT 2007
Hamish wrote:
> > 3. R/G/B vs B/G/R.
>
> I saw the reference to that in the man page, what uses BGR?
Nothing in GRASS uses it; I don't know how useful it would be
externally. Ultimately, you can always swap the fields by other means,
e.g. awk '{print $3,$2,$1}'.
> Is CMYK just a calculation or is it more involved?
It depends.
At the simplest level, RGB->CMYK is:
C' = 1-R
M' = 1-G
Y' = 1-B
K = min(C',M',Y')
C = C'-K
M = M'-K
Y = Y'-K
However, there are more complex implementations which use a profile
describing the actual colours of the inks; a common implementation
uses a matrix transformation. With such transformations, it's possible
that certain R/G/B colours (typically the "corners", where all
components are close to 0 or 1) cannot be represented as CMYK (i.e.
you end up with C/M/Y values outside of the 0-1 range).
> Would it be useful for anything, or just a gimmick?
I don't think that it's really the job of r.what.color to perform such
translations. If you need CMYK, it's quite likely that you'll want to
use a specific colour profile, gamma correction etc.
--
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev
mailing list