Rewrite applyPixelFunction (it was in the alpha_mask branch) to use vectorize so it is a reasonably fast. applyPixelFunction takes a single parameter a function pointer that takes in an rgb triplet and returns an rgb triplet. The user can do any operation on the triplet.
e.g.
def myFunc((r,g,b)):
return(b,g,r)
img.applyPixelFunc(myFunc)
Anonymous