title: writing image data to file in ruby using rmagick
body: <p>I want to write image to a file using rmagick. Given below is my code</p>
  
  <pre><code>im = "base64encodedstring"
  image = Magick::Image.from_blob(Base64.decode64(im)
  image[0].format = "jpeg"
  name ="something_temp"
  path = "/somepath/" + name
  File.open(path, "wb") { |f|
      f.write(image[0])
  }
  </code></pre>
  
  <p>I have also tried to use <code>f.write(image)</code>. But what get written in the file is <code>#&lt;Magick::Image:0x7eff0587f838&gt;</code>. What is the reason for this?</p>