本文实例讲述了Python实现去除图片中指定颜色的像素功能。分享给大家供大家参考,具体如下:
这里用python去除图片白色像素
需要python和pil
from PIL import Image
import numpy as np
import cv2
img2 = Image.open('./Amazing_COL_2Fix.bmp')
img1 = Image.open('./Amazing_RGB_2L.bmp')
# img1 = img1.convert('RGBA')
img2 = img2.convert('RGBA')
pixdata = img2.load()
for
1