add aditional threshold argument to get_pixel_threshold