var inverseAlpha = compileNativeFunction("rgba main(rgba in) { in.alpha = 255 - in.alpha; return in; }"); image.eachPixel(inverseAlpha);