Embedded XML in PNG image files
The PNG image file format supports embedded metadata in a number of ways. draw.io can export a PNG image of your diagram and include the diagram itself in the image, by including the XML code in the
zTxt section of the image file.
Embedding the diagram as metadata in an image lets you more easily transfer the file between products, vendors, and platforms without data loss. By including the diagram, the image retains all of the data necessary to continue working on it in the draw.io online diagram editor.
Open a diagram embedded in a PNG
.png file with the embedded diagram data onto the draw.io drawing canvas to keep editing it as you would a
.xml version of your diagram.
Note: Some popular image sharing sites may resample PNG images, stripping any unnecessary non-image data from the uploaded file to save space.
Save a diagram as a PNG
When you save your diagram as a PNG image, the XML of your diagram is included by default.
- Select File > Save as from the menu.
- Select Editable Bitmap Image (.png) from the drop down list next to the file name.
- Click on the location to which you want to save the PNG image file.
Export a PNG file with diagram data
- Select File > Export As > PNG.
- Choose the options you need for the image, and make sure the checkbox for Include a copy of my diagram is enabled as well as All Pages if you also want to include the other diagram pages in the PNG file.
- Click Export, enter a filename, then select the location to which you want to save your diagram.
You can also embed your diagram data when you export a PDF file or an SVG image in the same way.