-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
221 lines (201 loc) · 14.6 KB
/
MainWindow.xaml
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
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
<Window x:Class="ColorMatch3D.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ColorMatch3D"
mc:Ignorable="d"
Title="ColorMatch3D" MinHeight="900" Height="900" Width="1000" MinWidth="600">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="25"></RowDefinition>
</Grid.RowDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="250"></ColumnDefinition>
<ColumnDefinition Width="200"></ColumnDefinition>
</Grid.ColumnDefinitions>
<!-- Images -->
<Grid Grid.Column="0">
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="25"></RowDefinition>
<RowDefinition Height="5"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="25"></RowDefinition>
</Grid.RowDefinitions>
<Image Grid.Row="0" x:Name="ImageTop"></Image>
<DockPanel Grid.Row="1">
<Label>Test image</Label>
<Slider Minimum="0" Maximum="1" MinWidth="80" TickPlacement="BottomRight" TickFrequency="0.1" Value="1"></Slider>
<Label>Regrade</Label>
</DockPanel>
<GridSplitter Grid.Row="2" Height="3" VerticalAlignment="Center" HorizontalAlignment="Stretch" ShowsPreview="False">
</GridSplitter>
<Image Grid.Row="3" x:Name="ImageBottom"></Image>
<DockPanel Grid.Row="4">
<Label>Regrade</Label>
<Slider Minimum="0" Maximum="1" MinWidth="80" TickPlacement="BottomRight" TickFrequency="0.1" Value="1"></Slider>
<Label>Reference</Label>
</DockPanel>
</Grid>
<!-- Controls -->
<ScrollViewer Grid.Column="1">
<StackPanel>
<Button Click="SelectTest_Click">Select test image...</Button>
<DockPanel LastChildFill="True">
<Label >Test image is:</Label>
<RadioButton IsChecked="True">sRGB</RadioButton>
<RadioButton IsEnabled="False" >sRGB Linear</RadioButton>
</DockPanel>
<Button Click="SelectReference_Click">Select reference image...</Button>
<DockPanel LastChildFill="True">
<Label>Reference image is:</Label>
<RadioButton IsChecked="True" >sRGB</RadioButton>
<RadioButton IsEnabled="False" >sRGB Linear</RadioButton>
</DockPanel>
<StackPanel>
<DockPanel>
<Label>Subdivisions per dimension:</Label>
<TextBox>32</TextBox>
</DockPanel>
<WrapPanel>
<Button x:Name="btnMakeLUT" Click="BtnMakeLUT_Click">Export 3D LUT (.cube)</Button>
<Label>Export for:</Label>
<RadioButton IsChecked="True">sRGB</RadioButton>
<RadioButton IsEnabled="False" >sRGB Linear</RadioButton>
</WrapPanel>
<Button Background="Red" Foreground="White" FontWeight="Black" Click="DoColorMatch_Click">Run ColorMatch</Button>
<TextBlock TextWrapping="Wrap">Note: Loaded images must be 8-bit and in sRGB.</TextBlock>
<GroupBox Header="Batch processing">
<StackPanel>
<Button x:Name="btnSelectTestFolder" Click="btnSelectTestFolder_Click">Select test folder...</Button>
<Button x:Name="btnSelectReferenceFolder" Click="btnSelectReferenceFolder_Click">Select reference folder...</Button>
<Button x:Name="btnSelectOutputFolder" Click="btnSelectOutputFolder_Click">Select output folder...</Button>
<WrapPanel>
<Label>Test suffix</Label>
<TextBox MinWidth="50" x:Name="batchTestSuffix_text" TextChanged="batch_text_TextChanged">-test</TextBox>
</WrapPanel>
<WrapPanel>
<Label>Reference suffix</Label>
<TextBox MinWidth="50" x:Name="batchReferenceSuffix_text" TextChanged="batch_text_TextChanged">-ref</TextBox>
</WrapPanel>
<Button x:Name="btnDoColorMatchBatch" Background="Blue" Foreground="White" FontWeight="Black" Click="DoColorMatchBatch_Click" IsEnabled="False">Batch Process</Button>
</StackPanel>
</GroupBox>
</StackPanel>
</StackPanel>
</ScrollViewer>
<StackPanel Grid.Column="2">
<Label>Advanced settings</Label>
<Border BorderThickness="1" BorderBrush="LightGray" Margin="5"></Border>
<GroupBox Header="Lowpass Equalization (PRE)" ToolTip="Blurs the two images with a large radius, divides them and multiplies the result with one of the images to match the other one. Should get rid of big brightness irregularities between two images, like from a hotspot in one image, or large sized power windows, but precision of contrast in the final match can suffer.">
<StackPanel>
<WrapPanel>
<RadioButton x:Name="lowPassMatchNone_radio" Checked="LowPassMatch_radio_Checked" IsChecked="True">None</RadioButton>
<RadioButton x:Name="lowPassMatchReferenceToSource_radio" Checked="LowPassMatch_radio_Checked">Reference to test</RadioButton>
</WrapPanel>
<WrapPanel IsEnabled="{Binding ElementName=lowPassMatchReferenceToSource_radio, Path=IsChecked}">
<Label>Lowpass radius</Label>
<TextBox MinWidth="50" x:Name="lowpassEqualizeBlurRadius_Text" TextChanged="Lowpass_Text_TextChanged">10</TextBox>
</WrapPanel>
<GroupBox Header="Histogram Match (to preserve contrast)" FontSize="10" IsEnabled="{Binding ElementName=lowPassMatchReferenceToSource_radio, Path=IsChecked}">
<StackPanel>
<WrapPanel>
<RadioButton x:Name="lowPassHistoMatchYes_radio" Checked="LowPassMatch_radio_Checked" IsChecked="True">Yes</RadioButton>
<RadioButton x:Name="lowPassHistoMatchNo_radio" Checked="LowPassMatch_radio_Checked">No</RadioButton>
</WrapPanel>
<WrapPanel>
<Label>Percentile subdivisions</Label>
<TextBox MinWidth="50" x:Name="lowPassPercentileSubdivisions_Text" TextChanged="Lowpass_Text_TextChanged">100</TextBox>
</WrapPanel>
<WrapPanel>
<Label>Smoothing radius</Label>
<TextBox MinWidth="50" x:Name="lowPassHistoMatchSmoothRadius_Text" TextChanged="Lowpass_Text_TextChanged">20</TextBox>
</WrapPanel>
<WrapPanel>
<Label>Smoothing intensity (0-1)</Label>
<TextBox MinWidth="50" x:Name="lowPassSmoothingIntensity_Text" TextChanged="Lowpass_Text_TextChanged">1</TextBox>
</WrapPanel>
</StackPanel>
</GroupBox>
</StackPanel>
</GroupBox>
<Border BorderThickness="1" BorderBrush="LightGray" Margin="5"></Border>
<Label>Matching Method</Label>
<WrapPanel>
<RadioButton x:Name="useAbsoluteMatching_radio" IsChecked="True" IsEnabled="False" >absolute</RadioButton>
<RadioButton x:Name="useColorMatching_radio" IsEnabled="False" >color</RadioButton>
</WrapPanel>
<Label ToolTip="Defines what color space the averaging of target colors as well as interpolation (if checked) happens">Aggregation color space</Label>
<WrapPanel>
<RadioButton x:Name="useSRGBAggrSpace_radio" Checked="AggrSpace_radio_Checked" >sRGB</RadioButton>
<RadioButton x:Name="useSRGBLinearAggrSpace_radio" Checked="AggrSpace_radio_Checked" IsEnabled="False" >sRGB Linear</RadioButton>
<RadioButton x:Name="useXYZAggrSpace_radio" Checked="AggrSpace_radio_Checked" IsEnabled="False" >XYZ</RadioButton>
<RadioButton x:Name="useCIELabAggrSpace_radio" Checked="AggrSpace_radio_Checked" IsChecked="True">CIELab</RadioButton>
<RadioButton x:Name="useCIELChabAggrSpace_radio" Checked="AggrSpace_radio_Checked" IsChecked="False">
<TextBlock>CIELCh<TextBlock Text="ab">
<TextBlock.RenderTransform>
<!-- Typography.Variants="Superscript" didn't work -->
<TransformGroup>
<TranslateTransform Y="7"/>
<ScaleTransform ScaleX=".75" ScaleY=".75"/>
</TransformGroup>
</TextBlock.RenderTransform>
</TextBlock></TextBlock></RadioButton>
</WrapPanel>
<Label>Aggregation method</Label>
<WrapPanel>
<RadioButton x:Name="useMeanAggr_radio" IsChecked="True" IsEnabled="False" >Mean</RadioButton>
<RadioButton x:Name="useMedianAggr_radio" IsEnabled="False" >Median</RadioButton>
</WrapPanel>
<Label>Aggregation variable</Label>
<WrapPanel>
<RadioButton x:Name="aggrAbsolute_radio" Checked="AggrVariable_radio_Checked">Absolute color</RadioButton>
<RadioButton x:Name="aggrVector_radio" IsChecked="True" Checked="AggrVariable_radio_Checked" ToolTip="Aggregates the vector difference of color between source and target image instead of the absolute color value.">Vector</RadioButton>
<RadioButton IsEnabled="False" x:Name="aggrVectorFactor_radio" Checked="AggrVariable_radio_Checked" ToolTip="Aggregates the vector factor of color between source and target image. Aka the factor to multiply each color component by to reach the correct result.">VectorFactor</RadioButton>
</WrapPanel>
<Label ToolTip="Use interpolation if the 3D LUT needs to generalize better and not merely fit one image">Interpolation</Label>
<WrapPanel>
<RadioButton x:Name="interpNone_radio" Checked="Interp_radio_Checked">None (default)</RadioButton>
<RadioButton x:Name="interpSingleLinear_radio" Checked="Interp_radio_Checked" IsChecked="True" ToolTip="Takes the surrounding values and averages them.">Single Linear (good with vector)</RadioButton>
<RadioButton x:Name="interpDualLinear_radio" Checked="Interp_radio_Checked" ToolTip="Takes two surrounding values in each direction, calculates the change, averages all info.">Dual Linear (bad, avoid)</RadioButton>
</WrapPanel>
<GroupBox Header="Post match smoothing">
<StackPanel>
<WrapPanel>
<RadioButton x:Name="boxBlur3dDisabled_radio" IsChecked="True" Checked="postMatchSmoothing_radio_Checked">None (default)</RadioButton>
<RadioButton x:Name="boxBlur3dActive_radio" Checked="postMatchSmoothing_radio_Checked">3D box blur</RadioButton>
</WrapPanel>
<GroupBox Header="3d box blur smoothing settings" IsEnabled="{Binding ElementName=boxBlur3dActive_radio, Path=IsChecked}">
<StackPanel>
<WrapPanel>
<Label>Blur radius</Label>
<TextBox MinWidth="30" x:Name="boxBlur3dRadius_text" TextChanged="boxBlur3d_text_TextChanged">2</TextBox>
</WrapPanel>
<WrapPanel>
<Label>Blur strength (0.0-1.0)</Label>
<TextBox MinWidth="30" x:Name="boxBlur3dStrength_text" TextChanged="boxBlur3d_text_TextChanged">1.0</TextBox>
</WrapPanel>
<WrapPanel>
<Label FontSize="10">Protect luminance (0.0-1.0)</Label>
<TextBox MinWidth="30" x:Name="boxBlur3dProtectLuminance_text" TextChanged="boxBlur3d_text_TextChanged">1.0</TextBox>
</WrapPanel>
<CheckBox IsEnabled="False">Protect blacks</CheckBox>
<CheckBox IsEnabled="False">Protect whites</CheckBox>
<CheckBox IsEnabled="False">Protect neutrals</CheckBox>
<!--TODO mode to work on only the color planes in Lab mode for example? Stuff like that.-->
</StackPanel>
</GroupBox>
</StackPanel>
</GroupBox>
</StackPanel>
</Grid>
<DockPanel Grid.Row="1">
<Label>Status: </Label>
<TextBlock x:Name="Status_txt">Idle.</TextBlock>
</DockPanel>
</Grid>
</Window>