The ImageMagick website suggests to accomply -rotate
with -trim
:
The page or virtual canvas information of the image is also rotated. Use a
+repage
to remove the virtual canvas page information if it is unwanted.— https://imagemagick.org/script/command-line-options.php#rotate
But how does it really works? I tried
magick input.png -rotate 90 output1.png
magick input.png -rotate 90 +repage output2.png
And then
magick identify output1.png
magick identify output2.png
The output of identify
is the same:
output1.png PNG 410x212 410x212+0+0 8-bit sRGB 22951B 0.000u 0:00.000
output2.png PNG 410x212 410x212+0+0 8-bit sRGB 22951B 0.000u 0:00.000
The test image is here: https://github.com/jsx97/test/blob/main/input.png
jsx97 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.