how do its made? different shape cutting on picture

how do its made? different shape cutting on picture

Hi! I need help :( 

now I work currently working on a picture gallery but I would like to be added by users images and that must be pentagram :) and I can't 

What is the correct algorithm? 

please help me :(