The rotation option in the ImageMagick convert tool rotates the image, but adds a background color to fill in the blanks.
I look for a way to rotate, and then crop the largest rectangle containing the contents of the image. Is it possible with the help of convert ?
Edited by Mark Setchell ...
So, if your original rectangle is a chessboard created like this:
convert -size 512x512 pattern:checkerboard a.png

and you rotate it 20 degrees like this
convert -background fuchsia -rotate 20 a.png b.png

Do you need the largest rectangle that fits on a chessboard and does not contain pink?
source share