title: How to detect a blank column in a page using ImageMagick to distinguish two column papers
body: <p>I try to distinguish two-column pdf scientific papers using ImageMagick and locate the point where the two columns are separated using a bash script. </p>
  
  <p>My idea is to use a sliding window at the center of the page to find a window which is completely white. Something like:</p>
  
  <pre><code>  for i in {0..$page_width..$step} do 
       # get the color of a box 100x100+"$i"+50%
       # if the box is completely blank or 90% blank, then return ($i + 50)
    done
  </code></pre>
  
  <p>However, I don't know the code to check a box in the picture is completely blank.</p>
  
  <p>Sample image:</p>
  
  <p><a href="https://i.stack.imgur.com/82PZt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/82PZt.png" alt="enter image description here"></a></p>