#!/usr/bin/env python3

from PIL import Image
import sys

im = Image.open(sys.argv[1])
width, height = im.size
pixels = im.load()

for y in range(height):
	for x in range(width):
		p = pixels[x,y]
		if len(p) != 4:
			p = p + (255, )
		r, g, b, a = p
		if r != 0:
			pixels[x,y] = 255, 255, 255, 0

im.save(sys.argv[1])
