From: pandeng@telepath.com (Steve Schafer (TeamB)) Subject: Re: RGB to CMYK and viceversa Date: 18 Mar 1999 00:00:00 GMT Message-ID: <3716384c.153502595@90.0.0.40> Content-Transfer-Encoding: 7bit References: <7cqg2l$8lq11@forums.borland.com> Content-Type: text/plain; charset=us-ascii Organization: TeamB Mime-Version: 1.0 Reply-To: pandeng@telepath.com Newsgroups: borland.public.delphi.graphics On Thu, 18 Mar 1999 10:22:42 +0100, "Marco De Toni" wrote: >Does anybody tell me a more accurated way to convert CMYK to RGB and >viceversa (es. like Adobe Photoshop) I'm going to assume that your RGB values range from 0 to 255, and your CMYK values range from 0 to 100. RGB -> CMYK C := 100 - Round(100 * R / 255); M := 100 - Round(100 * G / 255); Y := 100 - Round(100 * B / 255); K := C; if M < K then K := M; if Y < K then K := Y; C := C - K; M := M - K; Y := Y - K; CMYK -> RGB R := 255 - Round(2.55 * (C + K)); if R < 0 then R := 0; G := 255 - Round(2.55 * (M + K)); if G < 0 then G := 0; B := 255 - Round(2.55 * (Y + K)); if B < 0 then B := 0; -Steve