I'm trying to use ImageMagick(7.1.1-43) to automatically crop a photograph of a coin, removing the surrounding background. I want to trim the image based on a "fuzz" factor, effectively removing the mostly-uniform color. However, my current command only trims the left side of the image, leaving the right side untouched.
My Goal:
I want to trim both the left and right sides of the image equally, removing as much of the wall as possible while preserving the coin.
Command Used:
./magick 20240614_093525.JPG -fuzz 51% -trim +repage img1.jpg
Original Image:
Returned Image:
What I've Tried:
I've tried adjusting the -fuzz percentage, but it doesn't seem to affect the left side trimming. Lowering it too much prevents any trimming, and raising it produces this error:
magick: geometry does not contain image `20240614_093525.JPG' @ warning/attribute.c/GetImageBoundingBox/554.
What command can I use to ensure both sides are trimmed?






