title: Measuring whitespace in a jpeg
body: <p>I want to measure the amount of a jpeg that is white/yellow (within a tolerance that can be adjusted).</p>
  <p>I am trying to develop a quality control tool that measures defects in almonds.  The defects are scratches in the skin of brown almonds (see image below).  Since these defects are white/yellow I would like a way to simply load the image into R and and have it measure the amount of the image that is white.  I can then experimentally determine an acceptable level.  All images would be the same size.</p>
  <p><img src="https://i.stack.imgur.com/JcJ8b.jpg" alt="Almond Picture" /></p>