Expression surface:write_to_png(filename) writes the content of the window or image surface surface into the PNG file filename. This function is not available for PDF and PS surfaces.
surface:write_to_png(filename)
surface
filename