add grey scale and threshold