Is it possible to trim an image based on a shape ?

Hi, I can't find a way to import an image, draw a shape over it and crop the image to that shape. Are there any solutions?