Cut of image with bezier curve

Hi,

i have a bezier curve that is generated dynamically now i want to mask an image with it to produce a cut of face functionality just like in elfyourself.com or in jibjab.com anyone have any idea about how they do the cut of face functionality … ??