title: Error in Using readPNG to read an edited png file created by Magick
body: <p>I'm trying to use <code>readPNG</code> to read a <a href="/questions/tagged/png" class="post-tag" title="show questions tagged &#39;png&#39;" rel="tag">png</a> file I created after using the <a href="/questions/tagged/magick" class="post-tag" title="show questions tagged &#39;magick&#39;" rel="tag">magick</a> package. This is a png file I combined from two images using the Magick package. I need to use readPNG to read it as a raster file so that I can later insert it into a map using annotate_custom. But I got an error message saying:</p>
  
  <blockquote>
    <p>file is not in PNG format</p>
  </blockquote>
  
  <pre><code>A &lt;- image_read("Alogo.jpg")
  image_trim(A)
  A_twick&lt;-image_resize(A, "130x130")
  print(A_twick)
  
  B &lt;- image_read("Blogo.jpg")
  image_trim(B)
  
  combined&lt;-image_append(c(B,A))
  print(combined)
  image_write(combined, "combinedlogo.png")
  
  logo &lt;- readPNG("logo/combinedlogo.png")
  # here is the error message "Error in readPNG("logo/combinedlogo.png") : file is not in PNG format"
  </code></pre>
  
  <p><code>RI2&lt;-RI+
          annotation_custom(combined, xmin=-71.92, xmax=-71.82, ymin=41.15, ymax=41.23)</code></p>
  
  <p>Did I miss anything? Or is there any workaround I could do to achieve my goal? Thank you in advance!</p>