You put Photoshop as the subject, so assuming you would like to handle
this with Adobe. You can use a number of built in tools to accomplish
this. One thing you can do is use the lasso tool to draw around the
edges in any particular pattern you like. After you trace the pattern
back to its orignal starting point, you will see the pattern selected,
you then can click ctrl + X, and it will delete the outer edges you
didn't lasso. This should give you the cropping pattern you selected.
An alternative to this would be to create 2 layers. The bottom layer
should be a blank tranparent background, and your top layer is the
image you want to crop. Select the top layer. Click the mask tool, and
then choose a brush. Make sure the mask section of the top layer is
selected, and use the brush to draw around the edges of your image.
Hope this answers your question.