home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!ames!agate!dog.ee.lbl.gov!network.ucsd.edu!ivem.ucsd.edu!spl
- From: spl@ivem.ucsd.edu (Steve Lamont)
- Newsgroups: comp.graphics
- Subject: Re: Converting CMYK to RGB - Help Me!
- Date: 31 Dec 1992 18:51:52 GMT
- Organization: University of Calif., San Diego/Microscopy and Imaging Resource
- Lines: 38
- Message-ID: <1hvfg8INNn8k@network.ucsd.edu>
- References: <1hvahuINN15l@life.ai.mit.edu>
- NNTP-Posting-Host: ivem.ucsd.edu
-
- In article <1hvahuINN15l@life.ai.mit.edu> bstevens@hal.gnu.ai.mit.edu (Bob Stevens) writes:
- >I'm trying to figure out a formula to convert CMYK values into RGB
- >values where the CMYK values are defined as a percentage (ie: 0.185 =
- >18.5%, 1 = 100%), but the RGB values are the absolute 0-255 value.
-
- An easy one.
-
- See Foley, van Dam, Feiner, and Hughes, _Computer Graphics: Principles
- and Practice, Second Edition_, pp. 587-589 for all of the gory (well,
- actually they're pretty sanitary) details.
-
- To convert from RGB to CMY you use the following:
-
- C = 1 - R
- M = 1 - G
- Y = 1 - B
-
- then convert to CMYK by
-
- K = min( C, M, Y )
- C = C - K
- M = M - K
- Y = Y - K
-
- Thus, going in the other direction, you'd just do
-
- R = 1 - ( C + K )
- G = 1 - ( M + K )
- B = 1 - ( Y + K )
-
- Multiply the results by 255 and you're home free.
-
- spl
- --
- Steve Lamont, SciViGuy -- (619) 534-7968 -- spl@szechuan.ucsd.edu
- UCSD Microscopy and Imaging Resource/UCSD Med School/La Jolla, CA 92093-0608
- "Living alone is living in perpetual irony and thinking, more and more
- frequently, Why not." - Joyce Carol Oates, "The Boyfriend"
-