im = Image.open('snapshot.jpg')
r, g, b = np.array(im).T
a = np.zeros_like(b)
a[b < 100] = 255
r = (b + g) * 5
im = Image.fromarray(np.dstack([item.T for item in (r, g, b, a)]))
im.save('output.png')
edit rgb values in a jpg with python