Ask Your Question

Revision history [back]

import image module from pillow

from PIL import Image

open the image

Image1 = Image.open('your image 1')

make a copy the image so that the original image does not get affected

Image1copy = Image1.copy() Image2 = Image.open('your image 2') Image2copy = Image2.copy()

paste image giving dimensions

Image1copy.paste(Image2copy, (70, 150)) # pick your coordinates

save the image

Image1copy.save('D:\pasted2.png')

click to hide/show revision 2
No.2 Revision

Code:

import image module from pillow

pillow from PIL import Image

open #open the image

image Image1 = Image.open('your image 1')

make #make a copy the image so that the # original image does not get affected

affected Image1copy = Image1.copy() Image2 = Image.open('your image 2') Image2copy = Image2.copy()

paste #paste image giving dimensions

dimensions Image1copy.paste(Image2copy, (70, 150)) # pick your coordinates

coordinates
#save the image Image1copy.save('D:\pasted2.png')

save the image

Image1copy.save('D:\pasted2.png')