Path: utzoo!attcan!lsuc!becker!bdb From: bdb@becker.UUCP (Bruce Becker) Newsgroups: comp.graphics Subject: Re: RGB color mixing/averaging Keywords: RGB, super-sampling, transparency Message-ID: <6020@becker.UUCP> Date: 15 Mar 90 09:59:35 GMT References: <173@yak.COM> Reply-To: bdb@becker.UUCP (Bruce Becker) Organization: G. T. S., Toronto, Ontario Lines: 43 In article <173@yak.COM> tpd6908@yak.COM (Tom Dickens) writes: |I am looking for a simple routine that will take 2 rgb values, a ratio |for mixing them (ie. 0.5), and will return the resulting rgb value. |This is desired for determining a pixel color after super-sampling, or when |combining colors while working with transparent surfaces. | |The problem I have is I expect the resulting rgb value to follow |'real world' results. (ie. case1: red+blue=purple, case2: blue+yellow=green) |Case1 works in rgb space, but case2 does not. I have read multiple |articles on the subject and have experimented with converting to HSV, |CMY, HLS spaces, linearly mixing, then converting back, but have not |gotten satisfactory results. I have an appreaciation for the physical |aspects of light and properties of different materials etc., but what I |need is a quick and simple method that works as expected. I am in the |process of deriving such a method since I have not found any papers |which address this. You need to convert to CIE coordinates in order to do this properly. In this color coordinate space color mixing occurs along a straight line between the given colors - this is not true of HLS, HSV, CMY, RGB, etc. Probably you ought to convert from rgb to CIE at the beginning and work in this form all the way through. Besides the efficiency gain, you end up with values that are independent of the color characteristics of any given display device or class of devices. Some references in which to look for more info and code are: Raster Graphics Handbook, 2nd Ed., Conrac Corporation, Van Nostrand Reinhold, 1985 Illumination and Color in Computer Generated Imagery, Roy Hall, Springer-Verlag, 1989 Cheers, -- (__) Bruce Becker Toronto, Ontario w \@@/ Internet: bdb@becker.UUCP, bruce@gpu.utcs.toronto.edu `/v/-e UUCP: ...!uunet!mnetor!becker!bdb _/ \_ "So far from God, so close to the United States" - Old Mexican proverb