Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!watcgl!awpaeth From: awpaeth@watcgl.UUCP Newsgroups: comp.graphics Subject: Re: Two questions. Message-ID: <2053@watcgl.waterloo.edu> Date: Fri, 16-Oct-87 13:58:41 EDT Article-I.D.: watcgl.2053 Posted: Fri Oct 16 13:58:41 1987 Date-Received: Sat, 17-Oct-87 16:06:10 EDT References: <12630002@acf4.UUCP> <6465@apple.UUCP> Reply-To: awpaeth@watcgl.waterloo.edu (Alan W. Paeth) Organization: U. of Waterloo, Ontario Lines: 80 In article <6465@apple.UUCP> turk@apple.UUCP (Ken "Turk" Turkowski) writes: >In article <12630002@acf4.UUCP> mascagni@acf4.UUCP (Michael Mascagni) writes: >>Two questions: >> >>1. Does anybody have the >> red(T), green(T), blue(T) functions for the black body radiation >>function where T is the absolute temperature of the radiating black body? >>If so what is it? On converting black-body color temperature to RGB coordinates: (1) get temperature in deg K. If in millirems, use (deg K) * (mrem) = 1e+6. (2) interpolate the table (created by integrating CIE chromaticity curves against the Stefan-Bolzmann curve for a perfect black-body radiator). This gives CIE chromaticity coordinates (x',y') (3) Compute z' = 1-x'-y'. Define the column vector [x' y' z']. (4) Pick a representative 3x3 matrix (below) based on your definition of "RGB", and compute: [R] [ ] [x'] [G] = [ MAT ] * [y'] [B] [ ] [z'] The result [R G B](transpose) will be of constant perceived intensity, and you might wish to apply a scaler multiply to provide desired final brightness. You will have to decide what to do if colors are "out of gamut", i.e. if they do not lie in the range [0..pixelmax]. This happens for highly saturated or bright colors. /Alan Paeth Table (black-body CIE chromaticity coordinates) ----- Temp-K x' y' peak wavelength (nanometers) 100 .735 .265 695 300 .734 .266 684 500 .721 .279 641.5 1000 .625 .345 606.7 1500 .586 .393 594.8 2000 .526 .413 588.9 2500 .477 .414 585.2 2854 .4476 .4074 583.5 3000 .437 .404 582.9 3500 .405 .391 580.9 4000 .380 .377 578.9 4500 .361 .363 577.2 4800 .351 .356 575.1 5000 .345 .352 572.6 5500 .332 .341 0 6000 .322 .332 0 6500 .313 .323 485.7 7000 .306 .314 483.7 8000 .295 .305 481.5 10000 .281 .288 479.4 24000 .253 .253 477.0 infin .240 .234 475.7 Matrices (derived through matrix inversion from chromaticity coordinates which were measured (matrix 1,2) or are defined (matrix 3,4) ---------- 1.93 -.545 -.325 Electrohome monitor (empirical) -.945 1.77 .045 .015 -.222 1.28 2.00 -.955 -.273 Aydin monitor (empirical) -1.00 2.18 -.091 0.0 -.227 1.36 1.73 -.48 -.26 based on NTSC definition of RGB chromaticity (derived) -.81 1.65 -.02 .08 -.17 1.28 2.13 -.92 -.40 RGB = 600, 550, 450 Angstroms (derived) -1.14 1.94 .17 .01 -.02 1.21