Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!linac!att!pacbell.com!ucsd!celit!billd From: billd@fps.com (Bill Davidson) Newsgroups: comp.graphics Subject: Re: RGB to CYMK?? Anybody know of an algorthim?? Keywords: RGB HSV CYMK color gamma Message-ID: <16499@celit.fps.com> Date: 23 Mar 91 00:31:42 GMT References: <1222@dms.UUCP> <1991Mar18.120406.4427@cs.city.ac.uk> Organization: FPS Computing Inc., San Diego CA Lines: 34 >In article <1222@dms.UUCP> rotberg@dms.UUCP (Ed Rotberg) writes: >>I'm looking for an algorithm or reference to one that would allow me to >>convert RGB values to CYMK and vice versa. An alternative would be >>the conversion to and from HSV from CYMK. Thanks for any and all help. In article <1991Mar18.120406.4427@cs.city.ac.uk> ans@city.cs.ac.uk (Ashley Salisbury) writes: >I too would very much like some info on this .. preferably some C source >code eg: Foley & van Dam & Feiner & Hughes (this is getting harder to type with the additional authors ;-) gives this algorithm on pages 588-589 (Pascal'ish pseudo-code converted to C'ish pseudo-code): Given R,G,B: C = 1 - R; M = 1 - G; Y = 1 - B; K = min(C,M,Y); C -= K; M -= K; Y -= K; This causes black to be used in place of equal amounts of CMY. You should also look at the warnings at the bottom of page 600. This algorithm looks nice and neat. The real world of 4 color printing isn't so nice and neat but this algorithm is a good starting point. Come to think of it, RGB isn't so nice and neat when you consider gamma errors (and worse) for CRT's. --Bill Davidson -- *ANOTHER* dumb move! -- Dick Spanner, Private Investigator