added binarization function and max, min pixel metadata