Possible bug -deskew auto-crop IM 6.9.5.4 Q16 Mac OSX
Posted: 2016-08-01T20:16:59-07:00
The documentation says:
-deskew threshold{%}
straighten an image. A threshold of 40% works for most images.
Use -set option:deskew:auto-crop width to auto crop the image. The set argument is the pixel width of the image background (e.g 40).
Perhaps I am confused about what the -set option is supposed to do and what the width means (final image width or amount to trim). Nevertheless, I cannot get the -set option to work.
Base image:
Rotate by 2 deg:
Deskew no auto-crop:
Deskew with auto-crop assuming width is amount to trim (10)
I also tried using -define rather than -set option (assuming there is an equivalent)
And also setting a background color (white):
But none of the auto-crop commands worked.
P.S. If there is a -define equivalent, then please add to the -defines on the options page.
-deskew threshold{%}
straighten an image. A threshold of 40% works for most images.
Use -set option:deskew:auto-crop width to auto crop the image. The set argument is the pixel width of the image background (e.g 40).
Perhaps I am confused about what the -set option is supposed to do and what the width means (final image width or amount to trim). Nevertheless, I cannot get the -set option to work.
Base image:
Rotate by 2 deg:
Code: Select all
convert lena.jpg -rotate 2 lena_r2.png
Deskew no auto-crop:
Code: Select all
convert lena_r2.png -deskew 40% lena_r2_deskew.png
Deskew with auto-crop assuming width is amount to trim (10)
Code: Select all
convert lena_r2.png -set option:deskew:auto-crop 10 -deskew 40% lena_r2_deskew_ac10a.png
I also tried using -define rather than -set option (assuming there is an equivalent)
Code: Select all
convert lena_r2.png -define deskew:auto-crop=10 -deskew 40% lena_r2_deskew_ac10b.png
Code: Select all
convert lena_r2.png -background white -set option:deskew:auto-crop 10 -deskew 40% lena_r2_deskew_ac10c.png
P.S. If there is a -define equivalent, then please add to the -defines on the options page.