title: Use CoreImage to detect and replace a white border from an image?
body: <p>Imagine you have a few hundred square images, say album cover art</p>
  
  <blockquote>
    <p><a href="https://i.stack.imgur.com/Y8sJr.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Y8sJr.jpg" alt="enter image description here"></a></p>
  </blockquote>
  
  <p>A few have a white border</p>
  
  <blockquote>
    <p><a href="https://i.stack.imgur.com/MQYFc.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MQYFc.jpg" alt="enter image description here"></a></p>
  </blockquote>
  
  <p>Notice the 10px or so border.</p>
  
  <p>I was just about to write some trivial raster code to detect and remove such borders - simply, fill them in with gray.</p>
  
  <p>But: could this be done in one swoop with core image in some way?</p>