1
from PIL import Image
# same pic trying to open all 4 in a array
imgs = map(Image.open, ('yeet2.png','yeet2.png','yeet2.png','yeet2.png'))
# creating a blank image
dest = Image.new('RGB', (1500,600))
# creating a 2x2 grid
for x in range(0, 2):
 for y in range(0, 2):
    z = (x + y)
    print(z)
    # not sure how to do the array in paste
    dest.paste(imgs[z], (500 * x, 200 * y))
dest.show()

i know there is already a question like this.. i want to know how to do it in PIL only without numpy...

1 Answers1

0

I tested your exact code with python 2.7 and PIL, it works fine. It should work the same way in python3.

What is the error message you have?

If you latter want to paste different images, you will have to fix:

z = (x + 2*y)
ch7kor
  • 184
  • 5