Small fix to improve performace if you don't mind. Shortly, I've changed
Dynamic[everything]
to
Dynamic[
applying image effects;
Dynamic[ composing images]
]
The point is that the outer Dynamic
(invisible explicitly but this is what Manipulate
does) is triggered by image effect parameters. The inner one is only triggered by those related to a position and a width of the division line. The outer one doesn't know what is inside the inner one so it won't be triggered when you move the line.
image1 = (*image*);
image2 = image1;
width = ImageDimensions[image1][[1]];
height = ImageDimensions[image1][[2]];
Manipulate[
image3 = ImageCompose[image2, SetAlphaChannel[ ImageAdjust[
GaussianFilter[image2, gaussian2], {contrast, brightness}], alpha]
];
Dynamic @ ImageCompose[
image1,
ImagePad[ ImageTake[image3, All, {1, width - div}], {{0, divthickness}, {0, 0}}, divcolor]
, {0, height}, {0, height}
]
,
Style["Image Processing Controls", Bold, Medium],
{{gaussian2, 10, "Blur Radius"}, 0, 60},
{{contrast, 0.25, "Contrast"}, 0, 1},
{{brightness, 0.26, "Brightness"}, 0, 1},
{{alpha, 0.45, "Opacity"}, 0, 1},
Delimiter,
Style["View", Bold, Medium],
{{div, width/2, "Comparison Line"}, width, 1},
{{divthickness, 1, "Line Thickness"}, 0, 4, 1},
{{divcolor, White, "Line Color"}, ColorSlider},
ControlPlacement -> Left]
Let's go one step further and replace the Dynamic
from above with:
EventHandler[
Dynamic[
ImageCompose[
image1,
ImagePad[ ImageTake[image3, All, {1, pos}], {{0, divthickness}, {0, 0}}, divcolor]
, {0, height}, {0, height}
]
],
{"MouseMoved" :> (pos = MousePosition["GraphicsAbsolute", {1, 1}][[1]])}
]
