module ChunkyPNG::RMagick

def export(canvas)

Returns:
  • (Magick::Image) - The RMagick image constructed from the Canvas instance.

Parameters:
  • canvas (ChunkyPNG::Canvas) -- The canvas to export.
def export(canvas)
  image = Magick::Image.new(canvas.width, canvas.height)
  image.import_pixels(0, 0, canvas.width, canvas.height, "RGBA", canvas.pixels.pack("N*"))
  image
end