我有一个规则集,如果此单元格的列表中有颜色,则删除单元格
image = PILImage.open('revamp'+img_url)
img = image
random_name = random_filename(path="revamp/media/colorfest/")
img.save(random_name, "PNG")
pixels = image.load()
for pos in area_id:
pixel = pixels[pos[0], pos[1]]
pixel = [pixel[0], pixel[1], pixel[2]]
if pixel in colors:
img.putpixel([pos[0], pos[1]], (0, 0, 0, 0))
img.save(random_name, "PNG")
response['status'] = 'ok'
这是我得到的,黑掉了细胞