Optimize preprocessing
Instead of using a series of operations on image data, and in some cases even duplicating it to do these operations (with dark optimization, the dark image is duplicated in memory and unaccounted for in avaialble memory checks - which apparently don't even exist for preprocessing anyway), we could find a way to compute all in the same loop, and maybe handle the normalization and factor values in a better way than currently.