title: How to -trim this image using ImageMagick?
body: <p>I understand <code>-trim</code> can be used to remove extra whitespace.</p>
  
  <p>How can Imagemagick be used to convert:</p>
  
  <p><strong>Note:</strong> The size of the bottom border to be removed is not known.</p>
  
  <p><a href="https://i.stack.imgur.com/mm4Sz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mm4Sz.png" alt="enter image description here"></a></p>
  
  <p>to</p>
  
  <p><a href="https://i.stack.imgur.com/0Morl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0Morl.png" alt="enter image description here"></a></p>
  
  <p><strong>Note:</strong> the default <code>-trim</code> flag does not work.</p>
  
  <p>The output of <code>convert -trim pre-trim.png post-trim.png</code> is:</p>
  
  <p><a href="https://i.stack.imgur.com/zMWbL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zMWbL.png" alt="enter image description here"></a></p>
  
  <p>which is missing the borders on the left and right.</p>