Bitwise operations is an advanced function for image analysis. It might seem thorny at first, but once you’ll get the hang of it, it opens new perspectives for more advanced and automated analysis of your samples.
A picture says more than a thousand words, except in peer reviewed publications where quantification of data often says more than a picture. In this newsletter we will further elaborate on a tool that will significantly improve your potential for image analysis.
Bitwise operations use 1 or 2 existing images to generate a new image as follows. Bitwise operations are operations that treat the images like bits and perform logical or Boolean functions on these bits. The bits are the series of zeros and ones. Depending on the application field of logical functions, 0 and 1 can have different interpretations. Overal in an image ‘0 and 1’ correspond to black and white pixels. Bitwise operations will thus work on binarized data.
The most common known logical or Boolean functions are AND, OR and NOT. Below you can find logical tables for each function. The AND operation compares two pixels, coming from two different existing images (A, B) and generates a new image with white pixels only if pixel 1 AND pixel 2 are white. The OR operation generates a white pixel if pixel 1 OR pixel 2 is white. The NOT operation is a unary operation generating ones complement, i.e. a white pixel for every black pixel and a black pixel for every white pixel. So in image processing, the following operations are applied to each pixel of theoriginal images, to determine what the resulting image will look like.