Encodes the image as PNG and returns the binary string.
to_png -> String
data = img.to_png File.binwrite("out.png", data)