This function has since been integrated into a standard Leaflet plugin, which you can find here:
This utility inverts all the images on a page and serves as a quick demo for the Image Sequencer library.
Images on the page must have access allowed with a CORS 'Access-Control-Allow-Origin' header.
Please drag the button below to your bookmarks bar to add the bookmarklet.
This bookmarklet processes any Leaflet.DistortableImage image with the #NDVI equation and applies a colormap:
Runs NDVI and a colormap on Leaflet tiles: