I have a series of photographs like the one shown.

(is is actually oriented as portrait - the forum seems to want to render it as landscape) The photos were taken with the picture placed on a table. I want to either crop it so that I am left with this:

(i.e. using the table top to simulate a wooden frame), or alternatively this:

(i.e. the minimum crop required to remove the irregular edges of the paper). As a start, I have tried
Code: Select all
convert image1.jpg -fuzz 10% -trim +repage image_fuzzy_trim.jpg
The placement of the picture within the frame is not constant.
Can I do this with ImageMagick?