I have these three pictures from a SEM Microscope. One is the actual picture whilst the other two just indicated the presence of specific elements (Aluminium and Silicon) on the sample.
I’d like to overlay them using Numpy and matplotlib so that I can then see where exactly the elements are, however not sure how to approach this on python, so far I’ve only gone as far as reading the picture files as np arrays:
image_SEM = np.asarray(Image.open('Project_SEI.JPG'))
image_Al = np.asarray(Image.open('Project_Al K.JPG'))
image_Si = np.asarray(Image.open('Project_Si K.JPG'))
Thank you!
>Solution :
You don’t need Numpy arrays at all for a simple overlay.
from PIL import Image
# Change to your file names, this is what mine downloaded as from your post
image_sem = Image.open('aZ8ED.jpg')
image_si = Image.open('HeiA7.jpg')
image_al = Image.open('HlcOR.jpg')
si_k = Image.blend(image_sem, image_si, 0.5)
si_k.show()
al_k = Image.blend(image_sem, image_al, 0.5)
al_k.show()
You’ll have to crop or work with the picture label in the lower right corner for your needs and perhaps the color scale on the left, but this should get you started. It worked for me.




