Couple of comment suggestions,
Code:
DC=DC.Blur(0.2) # Denoise Detection Clip [ avoid 'sparkles', prevent a few high/low extreme pixels from affecting histogram extremes too much ]
Code:
x =0 # Coords (for dc Detection Clip) [ if you have no need to avoid crud/noise around edges of DC clip ]
y =0
w=-0
h=-0
Code:
omin=0 # Output channels minimum (footroom for manual editing). [ If no need for extra user modification 'footroom/headroom', ie no further manual tweaking required ]
omax=255 # Output channels maximum (headroom for manual editing).