Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pil overlay images

import os
from PIL import Image

filename = 'pikachu.png'
ironman = Image.open(filename, 'r')
filename1 = 'bg.png'
bg = Image.open(filename1, 'r')
text_img = Image.new('RGBA', (600,320), (0, 0, 0, 0))
text_img.paste(bg, (0,0))
text_img.paste(ironman, (0,0), mask=ironman)
text_img.save("ball.png", format="png")
Comment

PREVIOUS NEXT
Code Example
Python :: opencv set window size 
Python :: python dataframe get numeric columns 
Python :: python faker 
Python :: godot string format 
Python :: how to get what type of file in python 
Python :: researchpy correlation 
Python :: how to join a list of characters in python 
Python :: Concatenate strings using Pandas groupby 
Python :: add y axis label matplotlib 
Python :: print random word python 
Python :: how to find python version 
Python :: escape string for html python 
Python :: string to float python pandas 
Python :: django models distinct 
Python :: remove n string 
Python :: time counter in python 
Python :: python emoji 
Python :: tensorflow keras save model 
Python :: python get lines from text file 
Python :: list methods python 
Python :: python read file txt and return list of each lines 
Python :: remove python2 centos 
Python :: how to convert an image to matrix in python 
Python :: remove empty strings from list python 
Python :: python move item in list to end 
Python :: show all rows python 
Python :: how to add row in spark dataframe 
Python :: remove nana from np array 
Python :: pandas get date from datetime 
Python :: how to get seconds from datetime in python 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =