title: Reverse black and white colors of image
body: <p>I'm searching for a way to reverse the colors of a black and white image that I have loaded into R. Consider the following example:</p>
  
  <p>With the <code>magick</code> package, I can load a JPEG image into R as follows:</p>
  
  <pre><code>library("magick")
  picture &lt;- image_read("path/picture.jpg")
  </code></pre>
  
  <p>I can also set the colors of this image to black and white:</p>
  
  <pre><code>picture &lt;- image_quantize(picture, colorspace = "gray")
  </code></pre>
  
  <p>However, I didn't find a way how to reverse the colors of this image (i.e. black gets white and white gets black). How could I do that in R?</p>