Created
July 10, 2020 14:06
-
-
Save lmacchiavelli/76de4b584db634e3e4095aa8ffb7ddb8 to your computer and use it in GitHub Desktop.
Incollare un immagine sopra uno sfondo con PIL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image, ImageDraw | |
background = Image.open("immagine-di-background.png" ) | |
immagine-da-incollare-sopra = Image.open('img/elementi/layoutB.png') | |
width, height = background.size | |
transparent = Image.new('RGBA', (width, height), (0,0,0,0)) | |
transparent.paste(background, (0,0)) | |
transparent.paste(immagine-da-incollare-sopra, (0,0)) | |
background.save('immagine-da-salvare.png') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment