分享一个Python自带库去水印的方法
今天用WPS将PDF转图片,发现没有会员就会自带水印,于是萌生了用Python去水印的想法
from itertools import product from PIL import Image img = Image.open('Your Image Path') width, height = img.size for pos in product(range(width), range(height)): if sum(img.getpixel(pos)[:3]) > 600: img.putpixel(pos, (255, 255, 255)) img.save('Your Output Path')