Files
filament/docs/math/White Balance.nb
Romain Guy 50adc1f661 Add per-view color grading LUT (#2615)
* Add the ability to set a ColorGrading LUT per View

In this change, material_sandbox allows to change the tone mapping
operator at runtime.

* Add Mathematica notebook used to explore white balance

The implementation is meant to reproduce the temperature/tint sliders
founds in Adobe Lightroom. The temperature can be offset from 2,000K
to 50,000K using a slider between -100 and +100 (-1.0 to 1.0 in our
API). The range of tint was modelled after the range used for the
temperature.

* Fix various issues

- A refactoring wrongly remamed the color grading pass
- Setting a View's ColorGrading to null selects the
  default color grading options

* Implement white balance in ColorGrading
2020-05-31 19:24:42 -07:00

1009 lines
42 KiB
Mathematica

(* Content-type: application/vnd.wolfram.mathematica *)
(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)
(* CreatedBy='Mathematica 12.1' *)
(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[ 158, 7]
NotebookDataLength[ 43156, 1000]
NotebookOptionsPosition[ 41071, 958]
NotebookOutlinePosition[ 41467, 974]
CellTagsIndexPosition[ 41424, 971]
WindowFrame->Normal*)
(* Beginning of Notebook Content *)
Notebook[{
Cell[CellGroupData[{
Cell[TextData[StyleBox["CIE 1931 2-deg, XYZ CMFs", "Subsection"]], \
"Subsubsection",
CellChangeTimes->{{3.7996982241825457`*^9, 3.7996982477885103`*^9}, {
3.79969850262654*^9,
3.799698508731106*^9}},ExpressionUUID->"1a2a6f85-9587-438e-baf4-\
87fab9cfd47e"],
Cell[CellGroupData[{
Cell[BoxData[{
RowBox[{
RowBox[{
RowBox[{"{",
RowBox[{"\[Lambda]", ",", "x", ",", "y", ",", "z"}], "}"}], "=",
RowBox[{
RowBox[{
"Import", "[",
"\"\<http://www.cvrl.org/database/data/cmfs/ciexyzjv.csv\>\"", "]"}],
"\[Transpose]"}]}], ";"}], "\[IndentingNewLine]",
RowBox[{"ListLinePlot", "[",
RowBox[{
RowBox[{"{",
RowBox[{
RowBox[{
RowBox[{"{",
RowBox[{"\[Lambda]", ",", "x"}], "}"}], "\[Transpose]"}], ",",
RowBox[{
RowBox[{"{",
RowBox[{"\[Lambda]", ",", "y"}], "}"}], "\[Transpose]"}], ",",
RowBox[{
RowBox[{"{",
RowBox[{"\[Lambda]", ",", "z"}], "}"}], "\[Transpose]"}]}], "}"}], ",",
RowBox[{"PlotLegends", "\[Rule]",
RowBox[{"{",
RowBox[{"\"\<X\>\"", ",", "\"\<Y\>\"", ",", "\"\<Z\>\""}], "}"}]}], ",",
RowBox[{"Filling", "\[Rule]", "Axis"}], ",",
RowBox[{"PlotStyle", "\[Rule]",
RowBox[{"{",
RowBox[{"Red", ",", "Green", ",", "Blue"}], "}"}]}]}], "]"}]}], "Input",
CellChangeTimes->{{3.799635017508616*^9, 3.7996350175142593`*^9}, {
3.799693199593113*^9, 3.799693222600195*^9}, {3.7996932581163282`*^9,
3.799693315664568*^9}, {3.7996934305363903`*^9, 3.79969346876785*^9}, {
3.799698464577858*^9, 3.79969847157952*^9}},
CellLabel->
"In[274]:=",ExpressionUUID->"151ac5d0-c087-4eac-b459-b03393d07da4"],
Cell[BoxData[
TemplateBox[{
GraphicsBox[{{},
GraphicsComplexBox[CompressedData["
1:eJzt2Hk4lO0eB3DZ8ioRpaKNiNNGHS0K3ZFCyd4rlShbkrTYtxkzzEwkei1t
JIr0Im9FQlJChfe1ZWRJlsyULJXURHWeuu/zO+/5//xzrmueP7i+13PNzHM/
3/v5zFw/lf1HrF1FRUREVKk/P/7/PMr9Uc39d3Iqv7ht/JnlApBEl06oX7kv
zk4BKNvL3mbXjCic8wMQt0ueFm6WiLNIIGqbf6/b4FgGzpaBiHeMcXna0nyc
0wJRzmlWWUniXZxHApFShq/t6k2PcEZB6Hfx6Ipz++pwjgtCtQ29n9Z8bcD5
ZRC6pLes+Xx/E87awUg6Umodc8kznGnBSL7t2IpKO5Lrg1GZefjYIuNmnBeG
oIG4C92SIY04+4SgONMtfz5Mrce5PASpn+G7zqghny8Ximx/Naj58PIp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J6ypqrxK5wpn0X+fvw4//fj
f3BeOD8Rzk+E8xPh/AT3L5yfCOcnwvmJcH4inJ/g/SGcnwjnJ8L5iXB+Ipyf
/MzC+YlwfvJ/Mj/5F2hruBQ=
"], {{{}, {
EdgeForm[],
Directive[
RGBColor[1, 0, 0],
Opacity[0.2]],
GraphicsGroupBox[{
PolygonBox[CompressedData["
1:eJwt0Mk2ggEABeCfisxTSEkazEOGzDNJhkhJOFYeQO+/83WOxXfvXd/MT7v+
2x0EQRff/z0hYnzZn3zQ4p0mbzSo80qNF56p8sQjD9xT4Y4yt5S44ZorLrng
nDNOOeGYIw45YJ89iuyywzZbFNhkg3XWWGWFZZZYZIE8ObJkmCfNHClmSZJg
hjjTTDFJrPMR44wxygjDDDHIAP30EaWXHiKECdH5/Q8lQRI6
"]]}]}, {}, {
EdgeForm[],
Directive[
RGBColor[0, 1, 0],
Opacity[0.2]],
GraphicsGroupBox[{
PolygonBox[CompressedData["
1:eJwt0Nk2ggEAhdGfN6g38EpuRck8VJIGs8wkMyFzRJIpD2hfuNhrfef2dMVT
3cnOIAg6iNBDyAjzq9v88M0Xn3zQ4p0mbzR45YU6zzxR45EH7rnjlhuuqXLF
JRdUOOeMU0445ohDDtinzB4ldtlhmy022WCdNVYpssIySyyywDxzzFIgT44s
M2SYJs0UKZIkmGSCccYYZYRhhhhkgDj9xIjSR+//33+iSzHa
"]]}]}, {}, {
EdgeForm[],
Directive[
RGBColor[0, 0, 1],
Opacity[0.2]],
GraphicsGroupBox[{
PolygonBox[CompressedData["
1:eJwlzEdSAgEARNEZMCAoegWvxNqVB9DTmUFQMWLOggkUM+YsiK/Kxatfvene
/sHUQCQIgpA+hug2ekjSRScJ4nQQo502WmkhSoQw/D9ryi8N6vzwzReffPDO
G6+88MwTjzxwT407brnhmisuuaDKOWdUKHPKCccccUiJIgfss8cuO2yzxSYb
rLPGKissU2CJRRaYZ45Z8swwzRQ5skySIc0E44wxygjD/AH5YUKJ
"]]}]}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}}, {{}, {}, {
Hue[0.67, 0.6, 0.6],
Directive[
PointSize[
NCache[
Rational[1, 90], 0.011111111111111112`]],
AbsoluteThickness[1.6],
RGBColor[1, 0, 0]],
LineBox[{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
86, 87, 88, 89, 90}]}, {
Hue[0.9060679774997897, 0.6, 0.6],
Directive[
PointSize[
NCache[
Rational[1, 90], 0.011111111111111112`]],
AbsoluteThickness[1.6],
RGBColor[0, 1, 0]],
LineBox[{91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117,
118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130,
131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156,
157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169,
170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180}]}, {
Hue[0.1421359549995791, 0.6, 0.6],
Directive[
PointSize[
NCache[
Rational[1, 90], 0.011111111111111112`]],
AbsoluteThickness[1.6],
RGBColor[0, 0, 1]],
LineBox[CompressedData["
1:eJwN0GciggEAANAvu8QdXMnPfjoAp7MSaVnJVplF9qwUMuL9eBd4YxNT45Oh
IAhiTDPDLHPME2eBBIsskWSZFGkyZMmxwiprrLNBnk0KbLHNDrvssc8BhxQp
UeaIY0445YxzKlS54JIaV1xzwy133PPAI08888IrdRo0eaNFm3c++KTDF9/8
8EuXPwJpIXropY9+BhhkiDARhokywij/w5VCZA==
"]]}}, {{
Directive[
PointSize[
NCache[
Rational[1, 90], 0.011111111111111112`]],
AbsoluteThickness[1.6],
RGBColor[1, 0, 0]]}, {
Directive[
PointSize[
NCache[
Rational[1, 90], 0.011111111111111112`]],
AbsoluteThickness[1.6],
RGBColor[0, 1, 0]]}, {
Directive[
PointSize[
NCache[
Rational[1, 90], 0.011111111111111112`]],
AbsoluteThickness[1.6],
RGBColor[0, 0, 1]]}}, {{
Directive[
PointSize[
NCache[
Rational[1, 90], 0.011111111111111112`]],
AbsoluteThickness[1.6],
RGBColor[1, 0, 0]]}, {
Directive[
PointSize[
NCache[
Rational[1, 90], 0.011111111111111112`]],
AbsoluteThickness[1.6],
RGBColor[0, 1, 0]]}, {
Directive[
PointSize[
NCache[
Rational[1, 90], 0.011111111111111112`]],
AbsoluteThickness[1.6],
RGBColor[0, 0, 1]]}, {}, {}, {}, {}, {}, {}, {}}, {{
Directive[
PointSize[
NCache[
Rational[1, 90], 0.011111111111111112`]],
AbsoluteThickness[1.6],
RGBColor[1, 0, 0]]}, {
Directive[
PointSize[
NCache[
Rational[1, 90], 0.011111111111111112`]],
AbsoluteThickness[1.6],
RGBColor[0, 1, 0]]}, {
Directive[
PointSize[
NCache[
Rational[1, 90], 0.011111111111111112`]],
AbsoluteThickness[1.6],
RGBColor[0, 0, 1]]}, {}, {}, {}, {}, {}, {}, {}}}], {{}, {}}}, {
DisplayFunction -> Identity, DisplayFunction -> Identity, AspectRatio ->
NCache[GoldenRatio^(-1), 0.6180339887498948], Axes -> {True, True},
AxesLabel -> {None, None}, AxesOrigin -> {370.7291666666667, 0},
DisplayFunction :> Identity, Frame -> {{False, False}, {False, False}},
FrameLabel -> {{None, None}, {None, None}},
FrameTicks -> {{Automatic, Automatic}, {Automatic, Automatic}},
GridLines -> {None, None}, GridLinesStyle -> Directive[
GrayLevel[0.5, 0.4]],
Method -> {
"OptimizePlotMarkers" -> True, "OptimizePlotMarkers" -> True,
"CoordinatesToolOptions" -> {"DisplayFunction" -> ({
Identity[
Part[#, 1]],
Identity[
Part[#, 2]]}& ), "CopiedValueFunction" -> ({
Identity[
Part[#, 1]],
Identity[
Part[#, 2]]}& )}},
PlotRange -> {{370.7291666666667, 825.}, {0, 1.6166}}, PlotRangeClipping ->
True, PlotRangePadding -> {{
Scaled[0.02],
Scaled[0.02]}, {
Scaled[0.02],
Scaled[0.05]}}, Ticks -> {Automatic, Automatic}}],
FormBox[
FormBox[
TemplateBox[{"\"X\"", "\"Y\"", "\"Z\""}, "LineLegend",
DisplayFunction -> (FormBox[
StyleBox[
StyleBox[
PaneBox[
TagBox[
GridBox[{{
TagBox[
GridBox[{{
GraphicsBox[{{
Directive[
EdgeForm[
Directive[
Opacity[0.3],
GrayLevel[0]]],
PointSize[0.5],
AbsoluteThickness[1.6],
RGBColor[1, 0, 0]], {
LineBox[{{0, 10}, {20, 10}}]}}, {
Directive[
EdgeForm[
Directive[
Opacity[0.3],
GrayLevel[0]]],
PointSize[0.5],
AbsoluteThickness[1.6],
RGBColor[1, 0, 0]], {}}}, AspectRatio -> Full,
ImageSize -> {20, 10}, PlotRangePadding -> None,
ImagePadding -> Automatic,
BaselinePosition -> (Scaled[0.1] -> Baseline)], #}, {
GraphicsBox[{{
Directive[
EdgeForm[
Directive[
Opacity[0.3],
GrayLevel[0]]],
PointSize[0.5],
AbsoluteThickness[1.6],
RGBColor[0, 1, 0]], {
LineBox[{{0, 10}, {20, 10}}]}}, {
Directive[
EdgeForm[
Directive[
Opacity[0.3],
GrayLevel[0]]],
PointSize[0.5],
AbsoluteThickness[1.6],
RGBColor[0, 1, 0]], {}}}, AspectRatio -> Full,
ImageSize -> {20, 10}, PlotRangePadding -> None,
ImagePadding -> Automatic,
BaselinePosition -> (Scaled[0.1] -> Baseline)], #2}, {
GraphicsBox[{{
Directive[
EdgeForm[
Directive[
Opacity[0.3],
GrayLevel[0]]],
PointSize[0.5],
AbsoluteThickness[1.6],
RGBColor[0, 0, 1]], {
LineBox[{{0, 10}, {20, 10}}]}}, {
Directive[
EdgeForm[
Directive[
Opacity[0.3],
GrayLevel[0]]],
PointSize[0.5],
AbsoluteThickness[1.6],
RGBColor[0, 0, 1]], {}}}, AspectRatio -> Full,
ImageSize -> {20, 10}, PlotRangePadding -> None,
ImagePadding -> Automatic,
BaselinePosition -> (Scaled[0.1] -> Baseline)], #3}},
GridBoxAlignment -> {
"Columns" -> {Center, Left}, "Rows" -> {{Baseline}}},
AutoDelete -> False,
GridBoxDividers -> {
"Columns" -> {{False}}, "Rows" -> {{False}}},
GridBoxItemSize -> {"Columns" -> {{All}}, "Rows" -> {{All}}},
GridBoxSpacings -> {
"Columns" -> {{0.5}}, "Rows" -> {{0.8}}}], "Grid"]}},
GridBoxAlignment -> {"Columns" -> {{Left}}, "Rows" -> {{Top}}},
AutoDelete -> False,
GridBoxItemSize -> {
"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
GridBoxSpacings -> {"Columns" -> {{1}}, "Rows" -> {{0}}}],
"Grid"], Alignment -> Left, AppearanceElements -> None,
ImageMargins -> {{5, 5}, {5, 5}}, ImageSizeAction ->
"ResizeToFit"], LineIndent -> 0, StripOnInput -> False], {
FontFamily -> "Arial"}, Background -> Automatic, StripOnInput ->
False], TraditionalForm]& ),
InterpretationFunction :> (RowBox[{"LineLegend", "[",
RowBox[{
RowBox[{"{",
RowBox[{
RowBox[{"Directive", "[",
RowBox[{
RowBox[{"PointSize", "[",
FractionBox["1", "90"], "]"}], ",",
RowBox[{"AbsoluteThickness", "[", "1.6`", "]"}], ",",
InterpretationBox[
ButtonBox[
TooltipBox[
GraphicsBox[{{
GrayLevel[0],
RectangleBox[{0, 0}]}, {
GrayLevel[0],
RectangleBox[{1, -1}]}, {
RGBColor[1, 0, 0],
RectangleBox[{0, -1}, {2, 1}]}}, DefaultBaseStyle ->
"ColorSwatchGraphics", AspectRatio -> 1, Frame -> True,
FrameStyle -> RGBColor[0.6666666666666666, 0., 0.],
FrameTicks -> None, PlotRangePadding -> None, ImageSize ->
Dynamic[{
Automatic, 1.35 CurrentValue["FontCapHeight"]/
AbsoluteCurrentValue[Magnification]}]],
StyleBox[
RowBox[{"RGBColor", "[",
RowBox[{"1", ",", "0", ",", "0"}], "]"}], NumberMarks ->
False]], Appearance -> None, BaseStyle -> {},
BaselinePosition -> Baseline, DefaultBaseStyle -> {},
ButtonFunction :> With[{Typeset`box$ = EvaluationBox[]},
If[
Not[
AbsoluteCurrentValue["Deployed"]],
SelectionMove[Typeset`box$, All, Expression];
FrontEnd`Private`$ColorSelectorInitialAlpha = 1;
FrontEnd`Private`$ColorSelectorInitialColor =
RGBColor[1, 0, 0];
FrontEnd`Private`$ColorSelectorUseMakeBoxes = True;
MathLink`CallFrontEnd[
FrontEnd`AttachCell[Typeset`box$,
FrontEndResource["RGBColorValueSelector"], {
0, {Left, Bottom}}, {Left, Top},
"ClosingActions" -> {
"SelectionDeparture", "ParentChanged",
"EvaluatorQuit"}]]]], BaseStyle -> Inherited, Evaluator ->
Automatic, Method -> "Preemptive"],
RGBColor[1, 0, 0], Editable -> False, Selectable ->
False]}], "]"}], ",",
RowBox[{"Directive", "[",
RowBox[{
RowBox[{"PointSize", "[",
FractionBox["1", "90"], "]"}], ",",
RowBox[{"AbsoluteThickness", "[", "1.6`", "]"}], ",",
InterpretationBox[
ButtonBox[
TooltipBox[
GraphicsBox[{{
GrayLevel[0],
RectangleBox[{0, 0}]}, {
GrayLevel[0],
RectangleBox[{1, -1}]}, {
RGBColor[0, 1, 0],
RectangleBox[{0, -1}, {2, 1}]}}, DefaultBaseStyle ->
"ColorSwatchGraphics", AspectRatio -> 1, Frame -> True,
FrameStyle -> RGBColor[0., 0.6666666666666666, 0.],
FrameTicks -> None, PlotRangePadding -> None, ImageSize ->
Dynamic[{
Automatic, 1.35 CurrentValue["FontCapHeight"]/
AbsoluteCurrentValue[Magnification]}]],
StyleBox[
RowBox[{"RGBColor", "[",
RowBox[{"0", ",", "1", ",", "0"}], "]"}], NumberMarks ->
False]], Appearance -> None, BaseStyle -> {},
BaselinePosition -> Baseline, DefaultBaseStyle -> {},
ButtonFunction :> With[{Typeset`box$ = EvaluationBox[]},
If[
Not[
AbsoluteCurrentValue["Deployed"]],
SelectionMove[Typeset`box$, All, Expression];
FrontEnd`Private`$ColorSelectorInitialAlpha = 1;
FrontEnd`Private`$ColorSelectorInitialColor =
RGBColor[0, 1, 0];
FrontEnd`Private`$ColorSelectorUseMakeBoxes = True;
MathLink`CallFrontEnd[
FrontEnd`AttachCell[Typeset`box$,
FrontEndResource["RGBColorValueSelector"], {
0, {Left, Bottom}}, {Left, Top},
"ClosingActions" -> {
"SelectionDeparture", "ParentChanged",
"EvaluatorQuit"}]]]], BaseStyle -> Inherited, Evaluator ->
Automatic, Method -> "Preemptive"],
RGBColor[0, 1, 0], Editable -> False, Selectable ->
False]}], "]"}], ",",
RowBox[{"Directive", "[",
RowBox[{
RowBox[{"PointSize", "[",
FractionBox["1", "90"], "]"}], ",",
RowBox[{"AbsoluteThickness", "[", "1.6`", "]"}], ",",
InterpretationBox[
ButtonBox[
TooltipBox[
GraphicsBox[{{
GrayLevel[0],
RectangleBox[{0, 0}]}, {
GrayLevel[0],
RectangleBox[{1, -1}]}, {
RGBColor[0, 0, 1],
RectangleBox[{0, -1}, {2, 1}]}}, DefaultBaseStyle ->
"ColorSwatchGraphics", AspectRatio -> 1, Frame -> True,
FrameStyle -> RGBColor[0., 0., 0.6666666666666666],
FrameTicks -> None, PlotRangePadding -> None, ImageSize ->
Dynamic[{
Automatic, 1.35 CurrentValue["FontCapHeight"]/
AbsoluteCurrentValue[Magnification]}]],
StyleBox[
RowBox[{"RGBColor", "[",
RowBox[{"0", ",", "0", ",", "1"}], "]"}], NumberMarks ->
False]], Appearance -> None, BaseStyle -> {},
BaselinePosition -> Baseline, DefaultBaseStyle -> {},
ButtonFunction :> With[{Typeset`box$ = EvaluationBox[]},
If[
Not[
AbsoluteCurrentValue["Deployed"]],
SelectionMove[Typeset`box$, All, Expression];
FrontEnd`Private`$ColorSelectorInitialAlpha = 1;
FrontEnd`Private`$ColorSelectorInitialColor =
RGBColor[0, 0, 1];
FrontEnd`Private`$ColorSelectorUseMakeBoxes = True;
MathLink`CallFrontEnd[
FrontEnd`AttachCell[Typeset`box$,
FrontEndResource["RGBColorValueSelector"], {
0, {Left, Bottom}}, {Left, Top},
"ClosingActions" -> {
"SelectionDeparture", "ParentChanged",
"EvaluatorQuit"}]]]], BaseStyle -> Inherited, Evaluator ->
Automatic, Method -> "Preemptive"],
RGBColor[0, 0, 1], Editable -> False, Selectable ->
False]}], "]"}]}], "}"}], ",",
RowBox[{"{",
RowBox[{#, ",", #2, ",", #3}], "}"}], ",",
RowBox[{"LegendMarkers", "\[Rule]",
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{"False", ",", "Automatic"}], "}"}], ",",
RowBox[{"{",
RowBox[{"False", ",", "Automatic"}], "}"}], ",",
RowBox[{"{",
RowBox[{"False", ",", "Automatic"}], "}"}]}], "}"}]}], ",",
RowBox[{"Joined", "\[Rule]",
RowBox[{"{",
RowBox[{"True", ",", "True", ",", "True"}], "}"}]}], ",",
RowBox[{"LabelStyle", "\[Rule]",
RowBox[{"{", "}"}]}], ",",
RowBox[{"LegendLayout", "\[Rule]", "\"Column\""}]}], "]"}]& ),
Editable -> True], TraditionalForm], TraditionalForm]},
"Legended",
DisplayFunction->(GridBox[{{
TagBox[
ItemBox[
PaneBox[
TagBox[#, "SkipImageSizeLevel"], Alignment -> {Center, Baseline},
BaselinePosition -> Baseline], DefaultBaseStyle -> "Labeled"],
"SkipImageSizeLevel"],
ItemBox[#2, DefaultBaseStyle -> "LabeledLabel"]}},
GridBoxAlignment -> {"Columns" -> {{Center}}, "Rows" -> {{Center}}},
AutoDelete -> False, GridBoxItemSize -> Automatic,
BaselinePosition -> {1, 1}]& ),
Editable->True,
InterpretationFunction->(RowBox[{"Legended", "[",
RowBox[{#, ",",
RowBox[{"Placed", "[",
RowBox[{#2, ",", "After"}], "]"}]}], "]"}]& )]], "Output",
CellChangeTimes->{{3.799693202154001*^9, 3.799693223818859*^9},
3.799693323819891*^9, {3.799693437467022*^9, 3.7996934751186037`*^9},
3.7996976291839943`*^9, 3.79969866589895*^9},
CellLabel->
"Out[275]=",ExpressionUUID->"256a4210-0eec-40f0-97c6-e83d6f913fde"]
}, Open ]],
Cell[BoxData[
RowBox[{"(*", " ",
RowBox[{
RowBox[{
"Color", " ", "temperature", " ", "in", " ", "XYZ", " ", "using", " ",
RowBox[{"Planck", "'"}], "s", " ", "radiation", " ",
RowBox[{"law", ".", "\[IndentingNewLine]", "See"}], " ",
RowBox[{"https", ":"}]}], "//",
RowBox[{
RowBox[{
RowBox[{
RowBox[{"en", ".", "wikipedia", ".", "org"}], "/", "wiki"}], "/",
"Planck"}], "%27", "s_law", "#Different", "_forms", " ",
RowBox[{
RowBox[{"(", "wavelength", ")"}], "."}]}]}], " ", "*)"}]], "Input",
CellChangeTimes->{{3.799698333760501*^9, 3.799698383375208*^9}, {
3.7996985894225903`*^9, 3.79969859018611*^9}, {3.7996987637937317`*^9,
3.7996987796452913`*^9}},ExpressionUUID->"b641840e-051e-4b4e-b167-\
bc3e6ad4ecd3"],
Cell[BoxData[{
RowBox[{
RowBox[{"\[Lambda]", "=",
RowBox[{"\[Lambda]", " ",
RowBox[{"10", "^",
RowBox[{"-", "9"}]}]}]}], ";"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"XYZ", "[", "t_", "]"}], ":=",
RowBox[{"Module", "[",
RowBox[{
RowBox[{"{",
RowBox[{
RowBox[{"h", "=",
RowBox[{"6.62607", "*",
RowBox[{"10", "^",
RowBox[{"-", "34"}]}]}]}], ",",
RowBox[{"c", "=",
RowBox[{"2.998", "*",
RowBox[{"10", "^", "8"}]}]}], ",",
RowBox[{"k", "=",
RowBox[{"1.38065", "*",
RowBox[{"10", "^",
RowBox[{"-", "23"}]}]}]}]}], "}"}], ",",
RowBox[{
RowBox[{
RowBox[{"{",
RowBox[{"x", ",", "y", ",", "z"}], "}"}], ".",
RowBox[{"(",
RowBox[{
RowBox[{"(",
RowBox[{"2", " ", "h", " ",
RowBox[{"c", "^", "2"}]}], ")"}], "/",
RowBox[{"(",
RowBox[{
RowBox[{"(",
RowBox[{
RowBox[{"-", "1"}], "+",
RowBox[{"E", "^",
RowBox[{"(",
RowBox[{
RowBox[{"(",
RowBox[{"h", " ",
RowBox[{"c", "/", "k"}]}], ")"}], "/",
RowBox[{"(",
RowBox[{"t", " ", "\[Lambda]"}], ")"}]}], ")"}]}]}], ")"}],
" ",
RowBox[{"\[Lambda]", "^", "5"}]}], ")"}]}], ")"}]}], "//",
RowBox[{
RowBox[{"#", "/",
RowBox[{"#", "[",
RowBox[{"[", "2", "]"}], "]"}]}], "&"}]}]}], "]"}]}]}], "Input",
CellChangeTimes->{{3.799635026824547*^9, 3.7996350268313503`*^9},
3.799635657078288*^9, {3.799672669897991*^9, 3.799672683139142*^9}, {
3.799672737193862*^9, 3.7996727538126793`*^9}, {3.799672823495021*^9,
3.799672851181918*^9}, {3.799672970031393*^9, 3.799673006668379*^9},
3.799698330596814*^9, {3.799698655146714*^9, 3.799698655760837*^9}},
CellLabel->
"In[277]:=",ExpressionUUID->"6457c5d8-ae11-4909-978d-b3e3a65b681d"]
}, Open ]],
Cell[CellGroupData[{
Cell[TextData[StyleBox["Color balance", "Subsection"]], "Subsubsection",
CellChangeTimes->{{3.7996982241825457`*^9,
3.7996982477885103`*^9}},ExpressionUUID->"1ed7ae1c-a39e-4675-bdce-\
9ca04f3a5686"],
Cell[BoxData[
RowBox[{
RowBox[{"(*", " ",
RowBox[{
RowBox[{
"xyY", " ", "y", " ", "coordinate", " ", "from", " ", "x", " ",
"coordinate", " ", "for", " ", "series", " ", "D", " ",
RowBox[{"illuminants", ".", "\[IndentingNewLine]", "See"}], " ",
RowBox[{"https", ":"}]}], "//",
RowBox[{
RowBox[{
RowBox[{
RowBox[{"en", ".", "wikipedia", ".", "org"}], "/", "wiki"}], "/",
"Standard_illuminant"}], "#Illuminant", "_series", "_D"}]}], " ",
"*)"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"illuminant", "[", "x_", "]"}], ":=",
RowBox[{
RowBox[{"2.87", "*", "x"}], "-",
RowBox[{"3", "*",
RowBox[{"x", "^", "2"}]}], "-", "0.275"}]}], "\[IndentingNewLine]",
"\[IndentingNewLine]",
RowBox[{"(*", " ",
RowBox[{
RowBox[{"k", " ", "=", " ", "temperature"}], ",", " ",
RowBox[{"from", " ", "-",
RowBox[{"100", " ", "to"}], " ", "+", "100"}], ",", " ",
RowBox[{"t", " ", "=", " ", "tint"}], ",", " ",
RowBox[{"from", " ", "-",
RowBox[{"100", " ", "to"}], " ", "+", "100"}]}], " ", "*)"}],
"\[IndentingNewLine]",
RowBox[{
RowBox[{"colorBalance", "[",
RowBox[{"k_", ",", "t_"}], "]"}], ":=",
RowBox[{"Module", "[", "\[IndentingNewLine]",
RowBox[{
RowBox[{"{",
RowBox[{"x", ",", "y"}], "}"}], ",", "\[IndentingNewLine]",
RowBox[{
RowBox[{"x", "=",
RowBox[{"0.31271", "-",
RowBox[{
RowBox[{"k", "/", "100"}], "*",
RowBox[{"If", "[",
RowBox[{
RowBox[{"k", "<", "0"}], ",", "0.214", ",", "0.066"}],
"]"}]}]}]}], ";", "\[IndentingNewLine]",
RowBox[{"y", "=",
RowBox[{
RowBox[{"illuminant", "[", "x", "]"}], "+",
RowBox[{
RowBox[{"t", "/", "100"}], "*", "0.066"}]}]}], ";",
"\[IndentingNewLine]",
RowBox[{"XYZColor", "[",
RowBox[{
RowBox[{"x", "/", "y"}], ",", "1", ",",
RowBox[{
RowBox[{"(",
RowBox[{"1", "-", "x", "-", "y"}], ")"}], "/", "y"}]}], "]"}]}]}],
"\[IndentingNewLine]", "]"}]}]}]}]], "Input",
CellChangeTimes->{{3.799632571383841*^9, 3.799632608292733*^9}, {
3.799632676235901*^9, 3.799632681498097*^9}, {3.799632827958025*^9,
3.799632925131782*^9}, {3.7996330903402863`*^9, 3.799633095618657*^9}, {
3.799633140723916*^9, 3.799633426512389*^9}, {3.799633460545279*^9,
3.799633469273794*^9}, {3.799633640885653*^9, 3.799633650781673*^9}, {
3.799633727981271*^9, 3.799633847020423*^9}, {3.799633891310361*^9,
3.7996339495947723`*^9}, {3.799634066192059*^9, 3.7996340683802757`*^9}, {
3.799634515764727*^9, 3.799634544153775*^9}, {3.799635040782217*^9,
3.799635075804644*^9}, {3.7996351262414017`*^9, 3.799635128117138*^9},
3.799635205063448*^9, {3.799635264602023*^9, 3.799635269805664*^9},
3.799635418420905*^9, {3.7996360480112877`*^9, 3.799636061433045*^9}, {
3.799636569873048*^9, 3.799636652616926*^9}, {3.7996367000437202`*^9,
3.7996367028166313`*^9}, {3.79963698849085*^9, 3.7996369976533203`*^9}, {
3.7996978422374897`*^9, 3.799697845864108*^9}, {3.799697900594455*^9,
3.79969790429821*^9}, {3.7996980240918713`*^9, 3.799698043753441*^9}, {
3.799698254105238*^9, 3.799698309118058*^9}},
CellLabel->
"In[279]:=",ExpressionUUID->"91479455-511b-4796-93de-c39fff6c9cde"],
Cell[TextData[StyleBox["Temperature/tint vs Planckian locus", "Subsection"]], \
"Text",
CellChangeTimes->{{3.799698156809493*^9, 3.79969816321318*^9}, {
3.799698234739921*^9,
3.7996982404248667`*^9}},ExpressionUUID->"b59472d3-1e5f-4fee-845e-\
c26d6c717e5f"],
Cell[BoxData[
RowBox[{
RowBox[{"(*", " ",
RowBox[{
"Reference", " ", "chromaticity", " ", "plot", " ", "with", " ", "sRGB",
" ", "gamut", " ", "and", " ", "D65", " ", "white", " ", "point"}], " ",
"*)"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"p1", "=",
RowBox[{"ChromaticityPlot", "[",
RowBox[{
RowBox[{"{",
RowBox[{"\"\<sRGB\>\"", ",",
RowBox[{"Table", "[",
RowBox[{
RowBox[{"XYZColor", "@",
RowBox[{"XYZ", "[", "i", "]"}]}], ",",
RowBox[{"{",
RowBox[{"i", ",", "2000", ",", "50000", ",", "50"}], "}"}]}],
"]"}]}], "}"}], ",",
RowBox[{"ImageSize", "\[Rule]", "Large"}], ",",
RowBox[{"Appearance", "\[Rule]", "\"\<VisibleSpectrum\>\""}], ",",
RowBox[{"PlotPoints", "\[Rule]", "50"}], ",",
RowBox[{"PlotTheme", "\[Rule]", "\"\<Marketing\>\""}]}], "]"}]}],
";"}]}]], "Input",
CellChangeTimes->{{3.799698313092388*^9, 3.799698325541086*^9}},
CellLabel->
"In[281]:=",ExpressionUUID->"f9b79059-5cb9-4951-917a-24c552fedc15"],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{
RowBox[{"(*", " ",
RowBox[{
"Plot", " ", "Planckian", " ", "locus", " ", "against", " ",
"chromaticity", " ",
RowBox[{"diagram", ".", " ", "Also"}], " ", "plots", " ", "the", " ",
"position", " ", "of", " ", "the", " ", "illuminant", " ", "defined", " ",
"by", " ", "a", " ", "temperature", " ", "and", " ", "tint", " ",
"offset", " ", "from", " ",
RowBox[{"D65", "."}]}], " ", "*)"}], "\[IndentingNewLine]",
RowBox[{"Manipulate", "[", "\[IndentingNewLine]",
RowBox[{
RowBox[{"Show", "[",
RowBox[{"p1", ",",
RowBox[{"ChromaticityPlot", "[",
RowBox[{
RowBox[{"colorBalance", "[",
RowBox[{"k", ",", "t"}], "]"}], ",",
RowBox[{"ImageSize", "\[Rule]", "Large"}], ",",
RowBox[{"PlotPoints", "\[Rule]", "50"}], ",",
RowBox[{"Appearance", "\[Rule]", "None"}], ",",
RowBox[{"PlotStyle", "\[Rule]",
RowBox[{"{",
RowBox[{"Green", ",",
RowBox[{"PointSize", "[", "0.01", "]"}]}], "}"}]}]}], "]"}]}],
"\[IndentingNewLine]", "]"}], ",", "\[IndentingNewLine]",
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{"k", ",", "0"}], "}"}], ",",
RowBox[{"-", "100"}], ",", "100"}], "}"}], ",",
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{"t", ",", "0"}], "}"}], ",",
RowBox[{"-", "100"}], ",", "100"}], "}"}]}], "\[IndentingNewLine]",
"]"}]}]], "Input",
CellChangeTimes->{{3.799632571383841*^9, 3.799632608292733*^9}, {
3.799632676235901*^9, 3.799632681498097*^9}, {3.799632827958025*^9,
3.799632925131782*^9}, {3.7996330903402863`*^9, 3.799633095618657*^9}, {
3.799633140723916*^9, 3.799633426512389*^9}, {3.799633460545279*^9,
3.799633469273794*^9}, {3.799633640885653*^9, 3.799633650781673*^9}, {
3.799633727981271*^9, 3.799633847020423*^9}, {3.799633891310361*^9,
3.7996339495947723`*^9}, {3.799634066192059*^9, 3.7996340683802757`*^9}, {
3.799634515764727*^9, 3.799634544153775*^9}, {3.799635040782217*^9,
3.799635075804644*^9}, {3.7996351262414017`*^9, 3.799635128117138*^9},
3.799635205063448*^9, {3.799635264602023*^9, 3.799635269805664*^9}, {
3.799635418420905*^9, 3.7996355518067217`*^9}, {3.799698523595182*^9,
3.799698556800757*^9}},
CellLabel->
"In[282]:=",ExpressionUUID->"a8d5ebad-752d-4a20-bf53-b51b85d0c7f4"],
Cell[BoxData[
TagBox[
StyleBox[
DynamicModuleBox[{$CellContext`k$$ = 0, $CellContext`t$$ = 0,
Typeset`show$$ = True, Typeset`bookmarkList$$ = {},
Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ =
1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{{
Hold[$CellContext`k$$], 0}, -100, 100}, {{
Hold[$CellContext`t$$], 0}, -100, 100}}, Typeset`size$$ = {
576., {282., 287.}}, Typeset`update$$ = 0, Typeset`initDone$$,
Typeset`skipInitDone$$ = True},
DynamicBox[Manipulate`ManipulateBoxes[
1, StandardForm,
"Variables" :> {$CellContext`k$$ = 0, $CellContext`t$$ = 0},
"ControllerVariables" :> {},
"OtherVariables" :> {
Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$,
Typeset`animator$$, Typeset`animvar$$, Typeset`name$$,
Typeset`specs$$, Typeset`size$$, Typeset`update$$, Typeset`initDone$$,
Typeset`skipInitDone$$}, "Body" :> Show[$CellContext`p1,
ChromaticityPlot[
$CellContext`colorBalance[$CellContext`k$$, $CellContext`t$$],
ImageSize -> Large, PlotPoints -> 50, Appearance -> None,
PlotStyle -> {Green,
PointSize[0.01]}]],
"Specifications" :> {{{$CellContext`k$$, 0}, -100,
100}, {{$CellContext`t$$, 0}, -100, 100}}, "Options" :> {},
"DefaultOptions" :> {}],
ImageSizeCache->{621., {341., 347.}},
SingleEvaluation->True],
Deinitialization:>None,
DynamicModuleValues:>{},
SynchronousInitialization->True,
UndoTrackedVariables:>{Typeset`show$$, Typeset`bookmarkMode$$},
UnsavedVariables:>{Typeset`initDone$$},
UntrackedVariables:>{Typeset`size$$}], "Manipulate",
Deployed->True,
StripOnInput->False],
Manipulate`InterpretManipulate[1]]], "Output",
CellChangeTimes->{{3.79963548269405*^9, 3.799635552455084*^9},
3.79963584043777*^9, 3.799636131854322*^9, 3.799637001792697*^9,
3.799672935690529*^9, {3.799672989095996*^9, 3.799673017848003*^9},
3.7996976302532787`*^9, {3.799697930480048*^9, 3.799697946728343*^9}, {
3.799698046634182*^9, 3.799698054798706*^9}, 3.799698666945218*^9},
CellLabel->
"Out[282]=",ExpressionUUID->"b4881322-a44e-49f9-9fc6-baa601b2a0cc"]
}, Open ]],
Cell[TextData[StyleBox["Temperature scale factors", "Subsection"]], "Text",
CellChangeTimes->{{3.799698108679871*^9,
3.799698112384754*^9}},ExpressionUUID->"17b39e86-24b9-4000-b2de-\
4c786c8160f4"],
Cell[BoxData[
RowBox[{
RowBox[{"XYZ2xyY", "[", "xyz_", "]"}], ":=",
RowBox[{"{",
RowBox[{
RowBox[{
RowBox[{"xyz", "[",
RowBox[{"[", "1", "]"}], "]"}], "/",
RowBox[{"(",
RowBox[{
RowBox[{"xyz", "[",
RowBox[{"[", "1", "]"}], "]"}], "+",
RowBox[{"xyz", "[",
RowBox[{"[", "2", "]"}], "]"}], "+",
RowBox[{"xyz", "[",
RowBox[{"[", "3", "]"}], "]"}]}], ")"}]}], ",",
RowBox[{
RowBox[{"xyz", "[",
RowBox[{"[", "2", "]"}], "]"}], "/",
RowBox[{"(",
RowBox[{
RowBox[{"xyz", "[",
RowBox[{"[", "1", "]"}], "]"}], "+",
RowBox[{"xyz", "[",
RowBox[{"[", "2", "]"}], "]"}], "+",
RowBox[{"xyz", "[",
RowBox[{"[", "3", "]"}], "]"}]}], ")"}]}], ",",
RowBox[{"xyz", "[",
RowBox[{"[", "2", "]"}], "]"}]}], "}"}]}]], "Input",
CellLabel->
"In[283]:=",ExpressionUUID->"ae126839-0976-4ee1-9094-b08a95a24b31"],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"redFactor", "=",
RowBox[{"Abs", "[",
RowBox[{
RowBox[{
RowBox[{"XYZ2xyY", "[",
RowBox[{"XYZ", "[", "2000", "]"}], "]"}], "[",
RowBox[{"[", "1", "]"}], "]"}], "-", "0.31271"}], "]"}]}]], "Input",
CellChangeTimes->{{3.7996728948277073`*^9, 3.799672959965103*^9}, {
3.799697311227035*^9, 3.79969732724277*^9}, {3.7996976681214333`*^9,
3.799697713323945*^9}, {3.799697983550215*^9, 3.799698012435688*^9}, {
3.7996981173044367`*^9, 3.79969813956184*^9}},
CellLabel->
"In[284]:=",ExpressionUUID->"4159dcda-f489-44d3-afc5-1bc5a08422e7"],
Cell[BoxData["0.2139756967699324`"], "Output",
CellChangeTimes->{{3.7996729538066807`*^9, 3.799673018189229*^9}, {
3.799697317869492*^9, 3.799697327943421*^9}, {3.799697620842779*^9,
3.7996976305947247`*^9}, 3.7996976802338867`*^9, 3.7996977150586243`*^9, {
3.799697988194819*^9, 3.799698017291986*^9}, 3.799698139920917*^9,
3.799698667273141*^9},
CellLabel->
"Out[284]=",ExpressionUUID->"df3b0df9-edf4-4a87-8543-c66bdda738a5"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"blueFactor", "=",
RowBox[{"Abs", "[",
RowBox[{
RowBox[{
RowBox[{"XYZ2xyY", "[",
RowBox[{"XYZ", "[", "50000", "]"}], "]"}], "[",
RowBox[{"[", "1", "]"}], "]"}], "-", "0.31271"}], "]"}]}]], "Input",
CellChangeTimes->{{3.799673023902585*^9, 3.799673024561625*^9}, {
3.7996976895675983`*^9, 3.7996977010552464`*^9}, {3.799697991920663*^9,
3.7996980147773037`*^9}, {3.799698142742086*^9, 3.799698145035707*^9}},
CellLabel->
"In[285]:=",ExpressionUUID->"308ff37e-dfa4-4423-bf0c-95197c27a12f"],
Cell[BoxData["0.06559976600982073`"], "Output",
CellChangeTimes->{
3.7996730258189983`*^9, {3.799697622670849*^9, 3.799697630600626*^9}, {
3.7996976933259783`*^9, 3.79969771633221*^9}, {3.799697992362425*^9,
3.7996980150253353`*^9}, 3.7996981453755407`*^9, 3.799698667279005*^9},
CellLabel->
"Out[285]=",ExpressionUUID->"b923efcd-103e-4f0e-bbf8-aa38e144767d"]
}, Open ]]
}, Open ]]
},
WindowSize->{1115, 1647},
WindowMargins->{{Automatic, 512}, {Automatic, 0}},
FrontEndVersion->"12.1 for Mac OS X x86 (64-bit) (March 18, 2020)",
StyleDefinitions->"Default.nb",
ExpressionUUID->"48bd8ea1-5b3e-40ff-9c43-0731d1f417de"
]
(* End of Notebook Content *)
(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[CellGroupData[{
Cell[580, 22, 263, 5, 46, "Subsubsection",ExpressionUUID->"1a2a6f85-9587-438e-baf4-87fab9cfd47e"],
Cell[CellGroupData[{
Cell[868, 31, 1360, 36, 52, "Input",ExpressionUUID->"151ac5d0-c087-4eac-b459-b03393d07da4"],
Cell[2231, 69, 23113, 490, 248, "Output",ExpressionUUID->"256a4210-0eec-40f0-97c6-e83d6f913fde"]
}, Open ]],
Cell[25359, 562, 776, 18, 52, "Input",ExpressionUUID->"b641840e-051e-4b4e-b167-bc3e6ad4ecd3"],
Cell[26138, 582, 1998, 57, 73, "Input",ExpressionUUID->"6457c5d8-ae11-4909-978d-b3e3a65b681d"]
}, Open ]],
Cell[CellGroupData[{
Cell[28173, 644, 202, 3, 46, "Subsubsection",ExpressionUUID->"1ed7ae1c-a39e-4675-bdce-9ca04f3a5686"],
Cell[28378, 649, 3430, 78, 241, "Input",ExpressionUUID->"91479455-511b-4796-93de-c39fff6c9cde"],
Cell[31811, 729, 263, 5, 41, "Text",ExpressionUUID->"b59472d3-1e5f-4fee-845e-c26d6c717e5f"],
Cell[32077, 736, 1081, 27, 73, "Input",ExpressionUUID->"f9b79059-5cb9-4951-917a-24c552fedc15"],
Cell[CellGroupData[{
Cell[33183, 767, 2395, 51, 178, "Input",ExpressionUUID->"a8d5ebad-752d-4a20-bf53-b51b85d0c7f4"],
Cell[35581, 820, 2252, 45, 707, "Output",ExpressionUUID->"b4881322-a44e-49f9-9fc6-baa601b2a0cc"]
}, Open ]],
Cell[37848, 868, 201, 3, 41, "Text",ExpressionUUID->"17b39e86-24b9-4000-b2de-4c786c8160f4"],
Cell[38052, 873, 965, 30, 30, "Input",ExpressionUUID->"ae126839-0976-4ee1-9094-b08a95a24b31"],
Cell[CellGroupData[{
Cell[39042, 907, 593, 13, 30, "Input",ExpressionUUID->"4159dcda-f489-44d3-afc5-1bc5a08422e7"],
Cell[39638, 922, 445, 7, 34, "Output",ExpressionUUID->"df3b0df9-edf4-4a87-8543-c66bdda738a5"]
}, Open ]],
Cell[CellGroupData[{
Cell[40120, 934, 548, 12, 30, "Input",ExpressionUUID->"308ff37e-dfa4-4423-bf0c-95197c27a12f"],
Cell[40671, 948, 372, 6, 34, "Output",ExpressionUUID->"b923efcd-103e-4f0e-bbf8-aa38e144767d"]
}, Open ]]
}, Open ]]
}
]
*)