Python PIL, '.show()' isn't execute by the program

Hi, I have a problem with this code, i use python and the fonction Image in PIL

image1 ='Image1.JPG')
image2 ='Image2.JPG')
image3 ='Image3.JPG')
L,l = image3.size
new_img1 = image1.resize((L,l))
new_img2 = image2.resize((L,l))
def masque_fusion1() : 
  for x in range(L) :    
    if x % 2 == 0 : 
      for y in range(l) : 
        r,g,b = new_img1.getpixel((x, y))
    else : 
      for y in range(l) : 
        r,v,b = new_img2.getpixel((x,y))
        image3.putpixel((x,y),(r,v,b))"image3_fusion1.JPG", )

When I run the program, everything works. However, the image does not appear and there is only this error message : <PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=1280x670 at 0x7F818DFD0F40>
I don’t understand because the .show() is supposed to show the image.
The code after the .show() is executed.
If you can help me, that would be nice.
Thanks in advance

Please use code formatting like this:

Your code here
1 Like