

When I got my first roll of black and white pictures back, I fell in love and to this day, my love of black and white photography runs deep. I thought that was just about the greatest thing since sliced bread.

One day, I discovered you could get black and white film. I would use up a roll of film every couple of weeks and couldn’t wait the three days it took to get my pictures back. It was a point and shoot Kodak and I loved taking pictures with that thing. If you are using v6, or older, use the following instead: convert im1.png im2.png -evaluate-sequence xor result.I got my first camera in middle school as a Christmas present from my parents. Or you can not bother writing any Python and just type the following ImageMagick command into your Terminal: magick im1.png im2.png -evaluate-sequence xor result.png You can sum the pixels by adding this at the end: print('Sum: '.format(np.sum(result))) Result = np.bitwise_xor(im1np, im2np).astype(np.uint8) Or you can use Numpy's XOR like this: #!/usr/local/bin/python3 ImageChops.logical_xor(Image.open("im1.png"), Image.open("im2.png")).save('result.png') Of course, if you are a physicist, you can write that like this -) #!/usr/local/bin/python3 You can use PIL's ImageChops like this: #!/usr/local/bin/python3 Xor_signal = xor_signal + int(bool(list_M) != bool(list_N)) There might be a more direct and efficient way to process the pixels in the two images. I wrote the following stub / proof of concept Python program, but worried that using the code (unpacking/translating over) would be complicated. How do you XOR all the corresponding entries and then sum them Suppose both bw_im2 and bw_im2 have the same size. Starting with two images im1 and im2 created with the PIL module, we have the corresponding black and white images, bw_im1 = im1.convert('1')Įach pixel of bw_im2 and bw_im2 is either 0 or 256.
