Bitwise logical operations on images