Philip's Image to Binary Bitmask converter (fixed)