title: How to programmatically remove the background of an image making it transparent in ruby?
body: <p>I have a bunch of images of products and I'd like to remove the background of each programmatically in ruby.  Here are some <a href="http://imgur.com/a/rVAbC" rel="noreferrer">example images</a> I put up on imgur.</p>
  
  <p><img src="https://i.stack.imgur.com/00oTL.jpg" alt="enter image description here"></p>
  
  <p>I'll put an example one here just so you can see but I didn't want to post a bunch of images.  This is the simplest of all of them.  It has just a white background but some of the products have more complex backgrounds.  I know doing something like this on <a href="https://i.imgur.com/qyN8C.jpg" rel="noreferrer">this image</a> probably isn't going to work so I'd like to figure that out and  fail gracefully by not actually removing the background and just notifying me somehow.</p>
  
  <p>I'm using ruby on rails 3 and <a href="https://github.com/jnicklas/carrierwave" rel="noreferrer">carrierwave</a> as my upload handler.</p>
  
  <p>Is this even possible or am I only really going to be able to remove white backgrounds?</p>