Thank you for the answers. Sorry for not being clear in the first place. So my original idea was, that I create a png image with the puzzle shape (I draw it with a graphical program), set the inside part to transparent and the outside part lets say to green. Then I mask this image with the original picture and set the green pixels to transparent.
But I'd like to add an extra functionality: The user can define a deformation rate, and so every piece would have a unique deformed shape. I don't know how to do this with the above method. So after some search I found that the common way to draw puzzle pieces is with Bezier curves. So I would give only the control points of the curve (and I slightly modify the control points to get a deformed shape), but this way I need to check every point if it's inside or outside the shape that the control points define. And therefore I need an algorithm to test for a point if it's outside or inside. (It would be enough, if I knew which side of a given curve is the point and test it for all of the four sides.) And I didn't know that I need to create such a test function myself (and if I need, how to do this) or OpenGL could handle this automatically for me.
By the way I need to create the puzzle pieces only once, then I'd store them (with their transparent bounding rectangle) on a bigger texture, and use that texture for drawing sprites.