Dealing with binary images whose values are 0 and 255