Converts image data types to a black-white (binary) image. The treshold value should be in the range [0,1].