Example of a sRGB-rendered blackbody color spectrum to illustrate the scaling problems energy versus quantal units. This image should be examined for scientific validity by an expert, and in the positive case replaced by a scalable (albeit larger) SVG file. This file is a response to <a href="//commons.wikimedia.org/wiki/File:Blackbody-sRGB.svg" title="File:Blackbody-sRGB.svg">File:Blackbody-sRGB.svg</a>. The colors are generated via the following steps: 1. Calculate the Planck spectral energy density as a function of the wavelength for a range of temperatures. 2. Calculate the <a href="https://en.wikipedia.org/wiki/en:CIE_1931_color_space" class="extiw" title="w:en:CIE 1931 color space">CIE XYZ 1931 tristimulus</a> (<strike>version modified by Judd 1951 and Vos 1978, </strike><a rel="nofollow" class="external autonumber" href="http://cvrl.ioo.ucl.ac.uk/index.htm">[1]</a>) for the spectra in each temperature step:
<dl><dd><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle X=\int _{0}^{\infty }I(\lambda )\,{\overline {x}}(\lambda )\,d\lambda }"><semantics><mrow class="MJX-TeXAtom-ORD"><mstyle displaystyle="true" scriptlevel="0"><mi>X</mi><mo>=</mo><msubsup><mo>∫<!-- ∫ --></mo><mrow class="MJX-TeXAtom-ORD"><mn>0</mn></mrow><mrow class="MJX-TeXAtom-ORD"><mi mathvariant="normal">∞<!-- ∞ --></mi></mrow></msubsup><mi>I</mi><mo stretchy="false">(</mo><mi>λ<!-- λ --></mi><mo stretchy="false">)</mo><mspace width="thinmathspace"></mspace><mrow class="MJX-TeXAtom-ORD"><mover><mi>x</mi><mo accent="false">¯<!-- ¯ --></mo></mover></mrow><mo stretchy="false">(</mo><mi>λ<!-- λ --></mi><mo stretchy="false">)</mo><mspace width="thinmathspace"></mspace><mi>d</mi><mi>λ<!-- λ --></mi></mstyle></mrow><annotation encoding="application/x-tex">{\displaystyle X=\int _{0}^{\infty }I(\lambda )\,{\overline {x}}(\lambda )\,d\lambda }</annotation></semantics></math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/9a8bbc8dc79f16950d7e898c645db066adb1eeb7" class="mwe-math-fallback-image-inline" aria-hidden="true" style="vertical-align: -2.338ex; width:22.096ex; height:5.843ex;" alt="{\displaystyle X=\int _{0}^{\infty }I(\lambda )\,{\overline {x}}(\lambda )\,d\lambda }"></span></dd>
<dd><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle Y=\int _{0}^{\infty }I(\lambda )\,{\overline {y}}(\lambda )\,d\lambda }"><semantics><mrow class="MJX-TeXAtom-ORD"><mstyle displaystyle="true" scriptlevel="0"><mi>Y</mi><mo>=</mo><msubsup><mo>∫<!-- ∫ --></mo><mrow class="MJX-TeXAtom-ORD"><mn>0</mn></mrow><mrow class="MJX-TeXAtom-ORD"><mi mathvariant="normal">∞<!-- ∞ --></mi></mrow></msubsup><mi>I</mi><mo stretchy="false">(</mo><mi>λ<!-- λ --></mi><mo stretchy="false">)</mo><mspace width="thinmathspace"></mspace><mrow class="MJX-TeXAtom-ORD"><mover><mi>y</mi><mo accent="false">¯<!-- ¯ --></mo></mover></mrow><mo stretchy="false">(</mo><mi>λ<!-- λ --></mi><mo stretchy="false">)</mo><mspace width="thinmathspace"></mspace><mi>d</mi><mi>λ<!-- λ --></mi></mstyle></mrow><annotation encoding="application/x-tex">{\displaystyle Y=\int _{0}^{\infty }I(\lambda )\,{\overline {y}}(\lambda )\,d\lambda }</annotation></semantics></math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/e4a1e7d73dcf8c62c0b4d8a9694bb3fa25566d71" class="mwe-math-fallback-image-inline" aria-hidden="true" style="vertical-align: -2.338ex; width:21.726ex; height:5.843ex;" alt="{\displaystyle Y=\int _{0}^{\infty }I(\lambda )\,{\overline {y}}(\lambda )\,d\lambda }"></span></dd>
<dd><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle Z=\int _{0}^{\infty }I(\lambda )\,{\overline {z}}(\lambda )\,d\lambda }"><semantics><mrow class="MJX-TeXAtom-ORD"><mstyle displaystyle="true" scriptlevel="0"><mi>Z</mi><mo>=</mo><msubsup><mo>∫<!-- ∫ --></mo><mrow class="MJX-TeXAtom-ORD"><mn>0</mn></mrow><mrow class="MJX-TeXAtom-ORD"><mi mathvariant="normal">∞<!-- ∞ --></mi></mrow></msubsup><mi>I</mi><mo stretchy="false">(</mo><mi>λ<!-- λ --></mi><mo stretchy="false">)</mo><mspace width="thinmathspace"></mspace><mrow class="MJX-TeXAtom-ORD"><mover><mi>z</mi><mo accent="false">¯<!-- ¯ --></mo></mover></mrow><mo stretchy="false">(</mo><mi>λ<!-- λ --></mi><mo stretchy="false">)</mo><mspace width="thinmathspace"></mspace><mi>d</mi><mi>λ<!-- λ --></mi></mstyle></mrow><annotation encoding="application/x-tex">{\displaystyle Z=\int _{0}^{\infty }I(\lambda )\,{\overline {z}}(\lambda )\,d\lambda }</annotation></semantics></math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/106f71f8daa2eb83308908afcd508cdd34aeb051" class="mwe-math-fallback-image-inline" aria-hidden="true" style="vertical-align: -2.338ex; width:21.559ex; height:5.843ex;" alt="{\displaystyle Z=\int _{0}^{\infty }I(\lambda )\,{\overline {z}}(\lambda )\,d\lambda }"></span></dd></dl><p>3. convert into sRGB using the corresponding matrices (this requires some rescaling to avoid oversaturation of any color channel).
</p>
<dl><dd><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\begin{bmatrix}R_{\mathrm {linear} }\\G_{\mathrm {linear} }\\B_{\mathrm {linear} }\end{bmatrix}}={\begin{bmatrix}3.2406&amp;-1.5372&amp;-0.4986\\-0.9689&amp;1.8758&amp;0.0415\\0.0557&amp;-0.2040&amp;1.0570\end{bmatrix}}{\begin{bmatrix}X\\Y\\Z\end{bmatrix}}}"><semantics><mrow class="MJX-TeXAtom-ORD"><mstyle displaystyle="true" scriptlevel="0"><mrow class="MJX-TeXAtom-ORD"><mrow><mo>[</mo><mtable rowspacing="4pt" columnspacing="1em"><mtr><mtd><msub><mi>R</mi><mrow class="MJX-TeXAtom-ORD"><mrow class="MJX-TeXAtom-ORD"><mi mathvariant="normal">l</mi><mi mathvariant="normal">i</mi><mi mathvariant="normal">n</mi><mi mathvariant="normal">e</mi><mi mathvariant="normal">a</mi><mi mathvariant="normal">r</mi></mrow></mrow></msub></mtd></mtr><mtr><mtd><msub><mi>G</mi><mrow class="MJX-TeXAtom-ORD"><mrow class="MJX-TeXAtom-ORD"><mi mathvariant="normal">l</mi><mi mathvariant="normal">i</mi><mi mathvariant="normal">n</mi><mi mathvariant="normal">e</mi><mi mathvariant="normal">a</mi><mi mathvariant="normal">r</mi></mrow></mrow></msub></mtd></mtr><mtr><mtd><msub><mi>B</mi><mrow class="MJX-TeXAtom-ORD"><mrow class="MJX-TeXAtom-ORD"><mi mathvariant="normal">l</mi><mi mathvariant="normal">i</mi><mi mathvariant="normal">n</mi><mi mathvariant="normal">e</mi><mi mathvariant="normal">a</mi><mi mathvariant="normal">r</mi></mrow></mrow></msub></mtd></mtr></mtable><mo>]</mo></mrow></mrow><mo>=</mo><mrow class="MJX-TeXAtom-ORD"><mrow><mo>[</mo><mtable rowspacing="4pt" columnspacing="1em"><mtr><mtd><mn>3.2406</mn></mtd><mtd><mo>−<!-- − --></mo><mn>1.5372</mn></mtd><mtd><mo>−<!-- − --></mo><mn>0.4986</mn></mtd></mtr><mtr><mtd><mo>−<!-- − --></mo><mn>0.9689</mn></mtd><mtd><mn>1.8758</mn></mtd><mtd><mn>0.0415</mn></mtd></mtr><mtr><mtd><mn>0.0557</mn></mtd><mtd><mo>−<!-- − --></mo><mn>0.2040</mn></mtd><mtd><mn>1.0570</mn></mtd></mtr></mtable><mo>]</mo></mrow></mrow><mrow class="MJX-TeXAtom-ORD"><mrow><mo>[</mo><mtable rowspacing="4pt" columnspacing="1em"><mtr><mtd><mi>X</mi></mtd></mtr><mtr><mtd><mi>Y</mi></mtd></mtr><mtr><mtd><mi>Z</mi></mtd></mtr></mtable><mo>]</mo></mrow></mrow></mstyle></mrow><annotation encoding="application/x-tex">{\displaystyle {\begin{bmatrix}R_{\mathrm {linear} }\\G_{\mathrm {linear} }\\B_{\mathrm {linear} }\end{bmatrix}}={\begin{bmatrix}3.2406&amp;-1.5372&amp;-0.4986\\-0.9689&amp;1.8758&amp;0.0415\\0.0557&amp;-0.2040&amp;1.0570\end{bmatrix}}{\begin{bmatrix}X\\Y\\Z\end{bmatrix}}}</annotation></semantics></math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/293a08b46d3a62bfb4956689b7012d357e0f9893" class="mwe-math-fallback-image-inline" aria-hidden="true" style="vertical-align: -4.005ex; width:52.166ex; height:9.176ex;" alt="{\displaystyle {\begin{bmatrix}R_{\mathrm {linear} }\\G_{\mathrm {linear} }\\B_{\mathrm {linear} }\end{bmatrix}}={\begin{bmatrix}3.2406&amp;-1.5372&amp;-0.4986\\-0.9689&amp;1.8758&amp;0.0415\\0.0557&amp;-0.2040&amp;1.0570\end{bmatrix}}{\begin{bmatrix}X\\Y\\Z\end{bmatrix}}}"></span></dd></dl><p>The sRGB gamma correction is the done for all <i>C</i> = <i>R</i>, <i>G</i>, <i>B</i> as follows:
</p>
<dl><dd><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle C_{\mathrm {srgb} }={\begin{cases}12.92C_{\mathrm {linear} },&amp;C_{\mathrm {linear} }\leq 0.0031308\\(1+a)C_{\mathrm {linear} }^{1/2.4}-a,&amp;C_{\mathrm {linear} }&gt;0.0031308\end{cases}}}"><semantics><mrow class="MJX-TeXAtom-ORD"><mstyle displaystyle="true" scriptlevel="0"><msub><mi>C</mi><mrow class="MJX-TeXAtom-ORD"><mrow class="MJX-TeXAtom-ORD"><mi mathvariant="normal">s</mi><mi mathvariant="normal">r</mi><mi mathvariant="normal">g</mi><mi mathvariant="normal">b</mi></mrow></mrow></msub><mo>=</mo><mrow class="MJX-TeXAtom-ORD"><mrow><mo>{</mo><mtable columnalign="left left" rowspacing=".2em" columnspacing="1em" displaystyle="false"><mtr><mtd><mn>12.92</mn><msub><mi>C</mi><mrow class="MJX-TeXAtom-ORD"><mrow class="MJX-TeXAtom-ORD"><mi mathvariant="normal">l</mi><mi mathvariant="normal">i</mi><mi mathvariant="normal">n</mi><mi mathvariant="normal">e</mi><mi mathvariant="normal">a</mi><mi mathvariant="normal">r</mi></mrow></mrow></msub><mo>,</mo></mtd><mtd><msub><mi>C</mi><mrow class="MJX-TeXAtom-ORD"><mrow class="MJX-TeXAtom-ORD"><mi mathvariant="normal">l</mi><mi mathvariant="normal">i</mi><mi mathvariant="normal">n</mi><mi mathvariant="normal">e</mi><mi mathvariant="normal">a</mi><mi mathvariant="normal">r</mi></mrow></mrow></msub><mo>≤<!-- ≤ --></mo><mn>0.0031308</mn></mtd></mtr><mtr><mtd><mo stretchy="false">(</mo><mn>1</mn><mo>+</mo><mi>a</mi><mo stretchy="false">)</mo><msubsup><mi>C</mi><mrow class="MJX-TeXAtom-ORD"><mrow class="MJX-TeXAtom-ORD"><mi mathvariant="normal">l</mi><mi mathvariant="normal">i</mi><mi mathvariant="normal">n</mi><mi mathvariant="normal">e</mi><mi mathvariant="normal">a</mi><mi mathvariant="normal">r</mi></mrow></mrow><mrow class="MJX-TeXAtom-ORD"><mn>1</mn><mrow class="MJX-TeXAtom-ORD"><mo>/</mo></mrow><mn>2.4</mn></mrow></msubsup><mo>−<!-- − --></mo><mi>a</mi><mo>,</mo></mtd><mtd><msub><mi>C</mi><mrow class="MJX-TeXAtom-ORD"><mrow class="MJX-TeXAtom-ORD"><mi mathvariant="normal">l</mi><mi mathvariant="normal">i</mi><mi mathvariant="normal">n</mi><mi mathvariant="normal">e</mi><mi mathvariant="normal">a</mi><mi mathvariant="normal">r</mi></mrow></mrow></msub><mo>&gt;</mo><mn>0.0031308</mn></mtd></mtr></mtable><mo fence="true" stretchy="true" symmetric="true"></mo></mrow></mrow></mstyle></mrow><annotation encoding="application/x-tex">{\displaystyle C_{\mathrm {srgb} }={\begin{cases}12.92C_{\mathrm {linear} },&amp;C_{\mathrm {linear} }\leq 0.0031308\\(1+a)C_{\mathrm {linear} }^{1/2.4}-a,&amp;C_{\mathrm {linear} }&gt;0.0031308\end{cases}}}</annotation></semantics></math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/ad0223ed36f7f2981d1b8c55dc7ad88216f67884" class="mwe-math-fallback-image-inline" aria-hidden="true" style="vertical-align: -2.671ex; width:49.481ex; height:6.509ex;" alt="{\displaystyle C_{\mathrm {srgb} }={\begin{cases}12.92C_{\mathrm {linear} },&amp;C_{\mathrm {linear} }\leq 0.0031308\\(1+a)C_{\mathrm {linear} }^{1/2.4}-a,&amp;C_{\mathrm {linear} }&gt;0.0031308\end{cases}}}"></span></dd></dl><ul><li>where <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle a=0.055}"><semantics><mrow class="MJX-TeXAtom-ORD"><mstyle displaystyle="true" scriptlevel="0"><mi>a</mi><mo>=</mo><mn>0.055</mn></mstyle></mrow><annotation encoding="application/x-tex">{\displaystyle a=0.055}</annotation></semantics></math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/24c3dfa31c8f66156fff566a959be9a21efb8e3c" class="mwe-math-fallback-image-inline" aria-hidden="true" style="vertical-align: -0.338ex; width:9.625ex; height:2.176ex;" alt="{\displaystyle a=0.055}"></span>.</li></ul>
The result is written into an RGB palette file which can than be visualized by gnuplot. Unlike <a href="//commons.wikimedia.org/wiki/File:Blackbody-sRGB.svg" title="File:Blackbody-sRGB.svg">File:Blackbody-sRGB.svg</a> the white point is near 6700 K, which is in agreement with the experience of the (midday) Sun being of a slightly yellowsh white hue.
<a href="//commons.wikimedia.org/wiki/User:SiriusB" title="User:SiriusB">SiriusB</a>
2011-09-03
<span class="int-own-work" lang="en">Own work</span>