img utils: improve functions

histogram() now use range instead of depth, to make it meangful with floats too.

add findOptimalRange() for finding best range for displaying an image, including a ratio of outliers.
Still need to check the speed of the "short-cut".
gui img: improve findBestRange() + additional test cases

improve speed of short cut, which now is always faster than the non short-cut version.
Also much simpler code.
gui img: fix when using DataArray instead of normal ndarray

also improve test case
gui slider: allow to use ndarray in addition to python lists

Almos entirely compatible, just a small tweak needed.
This saves some time for the histogram, as it doesn't need to be converted to python at every update (not checked though)
util: avoid checking rate limiter arg at every call

only check at init.
gui: change brightness contrast to use min/max + histogram

based on the new functions from the util

It includes the possibility to select the percentage of outliers to avoid in the auto BC.

Works a bit, still need many small improvements.