kangax/fabric.js — pull request #667 by aleph1 (2013-05-31 16:25:18+00:00)
Title: Added mask filter.

The mask filter currently assumes that the input and mask images are of
the same dimensions. I am planning on adding support for tiling and
offset, and thought I would use the background-repeat and
background-position properties from CSS. Any thoughts on this?

You can see a demo here:

http://resources.aleph-1.com/mask/

Also, is there a reason why calling canvas.renderAll() immedately after
applying filters causes them not to take effect? I have to delay the
call using a timeout otherwise the image does not appear to have the
mask applied.