最近想实现将小图根据坐标,贴到大图中去,但是我看网上的代码都忒长了吧,还有关于RGB的,现在暂时用不着那么复杂,于是乎就自己写了个,简介明了哈哈哈嗝
from PIL import Image
mother_image= Image.open("motherimg_path") #大图地址
im_crop=Image.open("childimg_path") #子图地址
mother_image.paste(im_crop,(a,b)) #括号中为左上角坐标,a为x坐标,b为y坐标
mother_image.save("path") #图片保存路径