%matplotlib inline
import cv2
from PIL import Image,ImageDraw,ImageFont
import matplotlib.pyplot as plt
import numpy as np
img = Image.new("RGB",(320,320),(255,180,0))
plt.imshow(img)
img.show()
img.save('yellow.jpeg',quality=100)
# 在图上写字
a = '我们不一样'
font = ImageFont.truetype('./platech.ttf',48)
draw = ImageDraw.Draw(img) # 新建画布绘画对象
draw.text( (5,5), a,(255,0,0),font= font)# 在新建的对象 上坐标(50,50)处开始画出红色文本
img_path = 'yellow.jpeg'
img2 = Image.open(img_path).convert('RGB').convert('RGBA')
img3=np.array(img2)
img_path = 'yinzhang.jpeg'
img3 = Image.open(img_path).convert('RGB')
resize_img = img3.resize((200, 200), Image.ANTIALIAS)
print(resize_img.size)
#加水印
layer = Image.new('RGBA', resize_img.size