Learn Before
Concept

Pasting Subimages (Pillow)

Cropped sections of an image (sub-images) can be pasted into other images, given that there is enough room in the image to fit the sub-image and that the color modes of the image and sub-image match. To perform this, use the paste() function. Like cropping, pasting requires a tuple containing the boundaries of where to paste. The size given by the tuple must match the size of the sub-image.

boundaries = (x1, y1, x2, y2) image.paste(sub-image, boundaries)

0

1

Updated 2021-07-11

Contributors are:

Who are from:

Tags

Python Programming Language

Data Science