home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / graphics / 13295 < prev    next >
Encoding:
Internet Message Format  |  1992-12-31  |  1.6 KB

  1. 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
  2. From: spl@ivem.ucsd.edu (Steve Lamont)
  3. Newsgroups: comp.graphics
  4. Subject: Re: Converting CMYK to RGB - Help Me!
  5. Date: 31 Dec 1992 18:51:52 GMT
  6. Organization: University of Calif., San Diego/Microscopy and Imaging Resource
  7. Lines: 38
  8. Message-ID: <1hvfg8INNn8k@network.ucsd.edu>
  9. References: <1hvahuINN15l@life.ai.mit.edu>
  10. NNTP-Posting-Host: ivem.ucsd.edu
  11.  
  12. In article <1hvahuINN15l@life.ai.mit.edu> bstevens@hal.gnu.ai.mit.edu (Bob Stevens) writes:
  13. >I'm trying to figure out a formula to convert CMYK values into RGB 
  14. >values where the CMYK values are defined as a percentage (ie: 0.185 = 
  15. >18.5%, 1 = 100%), but the RGB values are the absolute 0-255 value.
  16.  
  17. An easy one.
  18.  
  19. See Foley, van Dam, Feiner, and Hughes, _Computer Graphics: Principles
  20. and Practice, Second Edition_, pp. 587-589 for all of the gory (well,
  21. actually they're pretty sanitary) details.
  22.  
  23. To convert from RGB to CMY you use the following:
  24.  
  25.     C = 1 - R
  26.     M = 1 - G
  27.     Y = 1 - B
  28.     
  29. then convert to CMYK by 
  30.  
  31.     K = min( C, M, Y )
  32.     C = C - K
  33.     M = M - K
  34.     Y = Y - K
  35.  
  36. Thus, going in the other direction, you'd just do
  37.  
  38.     R = 1 - ( C + K )
  39.     G = 1 - ( M + K )
  40.     B = 1 - ( Y + K )
  41.  
  42. Multiply the results by 255 and you're home free.
  43.  
  44.                             spl
  45. -- 
  46. Steve Lamont, SciViGuy -- (619) 534-7968 -- spl@szechuan.ucsd.edu
  47. UCSD Microscopy and Imaging Resource/UCSD Med School/La Jolla, CA 92093-0608
  48. "Living alone is living in perpetual irony and thinking, more and more
  49. frequently, Why not."   - Joyce Carol Oates, "The Boyfriend"
  50.