Inkscape uses the filetype .SVG by default, which stands for Scalable Vector Graphics. This filetype retains editable objects and layers that you create in your compositions, thus allowing you to re-open the file at a later time and continue to edit the original elements of your compositions.
However, there are many instances where you would want to export your files as another filetype, such as a PNG, to make your compositions more accessible or easier to open on a device (for people not using Inkscape). You may also want to upload your design to a website, or your printer may prefer a PNG file over an SVG file.
PNG stands for Portable Network Graphics, and “contains a bitmap of indexed colors and uses lossless compression, similar to a .GIF file but without copyright limitations. PNG files are commonly used to store graphics for web images.” (according to FileInfo.com). PNGs tend to be slightly better quality than a JPEG, though they are often slightly larger in file size as a result. PNGs also support graphics that contain a transparent background (whereas JPEGs do not).
Whatever the reason you are wanting to use a PNG, Inkscape allows you to easily export to this filetype should you ever need to. Here’s how.
For this article, I’ll be using my Isometric Phone Design I created in a recent Inkscape video tutorial. I hid my background layer in the layers panel (denoted by the red arrow in the photo above), and also made my canvas a checkerboard background so you can see where the composition is transparent (I recommend checking out my tutorial on How to Make Your Inkscape Canvas Look Like Adobe Illustrator’s Artboard, where I go over setting up your document properties).
1. Export Page to PNG Image
Once everything is set up and ready to export, I can go to File>Export PNG Image (red arrow in the image above).
This will bring up the Export PNG Image dialogue on the right side of my canvas (highlighted in red in the photo). My first option is to select a tab under the “Export Area,” with four different settings to choose from. If I want to export everything inside the border of my canvas (so, essentially the entire composition), I will choose the “Page” Export Area option (green arrow). You will see two columns and three rows with numerical data in this section, as well as a dropdown box to select a unit (my image/canvas is currently in px, or pixels).
The first two values at the top of this section are “x0” and “y0” (highlighted in green above). These values represent where the lower left boundary or corner of your image will be located (in other words, the starting coordinates of your image). The X variable always represents the width, and the Y always represents the height. Since we are going to export the entire page, our image starts at the coordinates of 0 for x and 0 for y.
The next values are “x1” and “y1” (highlighted in green above). These values represent where the top right boundary or corner of your image will be located (in other words, the ending coordinates of your document). My total canvas size for this composition was 1920 pixels by 1080 pixels, and so my x1 coordinate is 1920 and my y1 coordinate is 1080 (remember, my page units are set to pixels via the Units dropdown in this section).
The final two values in this section are Width and Height, and they reflect the total size of my export area. My Width is shown as 1920 and my Height is 1080 because this is the size of my entire canvas. So, the PNG will be the same size as my canvas when exported.
The next section of the Export PNG Image dialogue is the “Image Size” (highlighted in green above). This section allows you to adjust the overall width and height of your final image size based on the overall the resolution of the image. The resolution is determined by how many pixels, or “dots,” you want displayed per every inch of your image (pixels and dots are essentially the same thing – they are the smallest unit of a picture. Though dpi, or Dots Per Inch, is commonly used when working with printers, since printers produce dots, and pixels are more commonly used when describing images displayed on a computer). The more pixels or dots you have displayed in an area, the higher resolution the image will be. However, there is a trade-off to having higher resolution as it makes your overall file size larger. You can adjust your resolution via the box pointed out by the red arrow in the photo above.
So, for example, if I know I need my image to have a final resolution of 300 dpi (dots per inch), I can set the resolution by typing “300” in the dpi field (red arrow). If I hit the tab key, you’ll notice that my image width and height will suddenly change (highlighted green area). Because I increased the resolution from 96 to 300, the image will now be a higher-resolution image (more dots displayed in every inch of the image). As a result, my overall image size is now much larger (my width and height went from 1920×1080 to 6000×3375).
If, on the other hand, I decrease my resolution by typing “72” in the first dpi field, you will see that my image size will shrink down to 1440×810. This is because I now have a lower resolution image, with less dots displayed per every inch in my image.
I will change the value back to the default value of 96 dpi.
Below the Image Size section is the option to set the name of the file you want to export your image as, as well as the location on your computer where you want to export it (highlighted in green). It will export your file to the last location that you used to save any other file on Inkscape, or whatever the default location is that is currently set up on your Inkscape if you haven’t saved a file yet.
To change the name of your file or where it is being exported, click the “Export As” button (red arrow in the photo above).
Here, you will be taken to your file explorer or finder window (depending on what operating system you are using) where you can search your computer for a file location to save to. In my case, I am on my (D:) drive, in a folder titled “Photos,” and in another folder titled “Inkscape Photos” (you can see the full folder location in the highlighted green area in the image above).
I have exported this file before using the name “Phone Isometric Design Gen 3.png,” hence why my filename shows up as this by default (red arrow). I will change the name to “Isometric Phone Design No Background.”
If I click on the “Save as Type” dropdown, “PNG” will be the only option available. Inkscape only exports to PNG. If you need to export to something like a JPEG file or another file type, you will have to export your file to a PNG from Inkscape, then open up another program like GIMP (another awesome free program, which I have hundreds of tutorials for) and export to whatever filetype you want.
Once I’m ready to export, I’ll click the “Save” button.
But wait! You aren’t done yet – there is one last crucial step before your image is actually exported. You have to click the button labeled “Export” with the green check mark to actually export the file (red arrow in the image above). If you don’t click this button, your file won’t be exported. After I have clicked this button, my SVG file will now be exported to a PNG file.
Note: if you check the “Close when complete” option to the left of the Export button (outlined in blue in the photo above), the Export PNG Image dialogue box will close after you complete your export.
2. Export Drawing to PNG Image
The last section discussed the option to export your entire page to a PNG file, but what if you only want to export the drawing on the page, and not the empty space around it?
Well, the second tab under the Export Area section allows you to do just that. After going to File>Export PNG Image to bring up the Export PNG Image dialogue box (assuming you don’t have it open already from the previous step), you can click on the tab labeled “Drawing” under the Export Area section (red arrow).
This option will only export the area of our image that contains a drawing. So, in this case, it will only export the area that has the phone design in it. All of the empty space between the phone design and the canvas boundary will not make it to the final exported PNG. This is reflected in our values for our image coordinates, which have now changed compared to what they were under the “Page” setting.
Now, my x0 value is 317.278 pixels, and my y0 value is 121.273 pixels (highlighted in green). This is the new location for the bottom left corner of my image (or the starting coordinates).
Additionally, my x1 value is now 1602.722 pixels and my y1 value is 911.076. This is the new location for the top right corner of my image (or the ending coordinates).
So, my image export area will now no longer cover the entire length of my canvas (1920×1080 pixels). It will be smaller since it is getting rid of the empty space around the drawing. This is confirmed by the new Width and Height (outlined in green). My Width is now 1285.444 and my new Height is now 789.803 (both values in pixels).
Under the Image Size section (outlined in green in the image above), I can once again change the resolution of my image, which will either increase or decrease the final Width and Height of the export PNG. The Width and Height show up as 1285×790 pixels because the values from the previous section have been rounded. Inkscape cannot export a fraction of a pixel, so the values must be rounded to the nearest whole number.
When you are ready to export the drawing, you can once again click the “Export As” option (red arrow) to change the filename and location (I changed my filename to “Isometric Phone Drawing”), then click the “Export” button to export your SVG to PNG (blue arrow).
Above is the final exported drawing. If you highlight the photo with your mouse, you will notice that the boundary of the image ends where the drawing ends (note: it has been scaled down a bit for this article).
3. Export Selection to PNG
Apart from exporting your entire composition and exporting just the drawing, you can also narrow down your exported area to just a selection.
So, let’s say hypothetically that I want to export only the front face of my phone. I can grab the selection tool from my toolbox (red arrow in the photo above), then shift click on all of the elements I want to select to export (I clicked on all of the shapes that make up the front face of the phone). With all of these elements selected, you will now see that under the Export PNG Image dialogue, the Export Area tab has automatically changed to the “Selection” tab (green arrow in the photo).
My starting and ending coordinates now reflect the starting and ending points of my selected areas, and the Width and Height of my image has changed to match the dimensions of this area (outlined in green in the photo above).
I can once again change the resolution of my image under the Image Size section (outlined in red), which will increase or decrease the overall size of the image depending on the resolution set.
I can also change the name of my file (I changed it this time to “Isometric Phone Front Face”) and location where I want to save it using the Export As button under the Filename section (outlined in blue), then click “Export” to export the select to a PNG. There are also a few other options here as well that are worth mentioning. First, I can “Batch export” the objects I selected, meaning each object will be exported as a separate PNG. Below that, I have the option to “Hide all except selected,” which means that whatever I did not select will not show up in the final composition. If I do not check this option, the items I did not select will still be displayed so long as they fit in the frame area I am exporting to.
Above are the two different results of exporting the selection – on the left is the result with the “Hide all except select” option unchecked, and the result on the right is with that option checked.
4. Export Custom Area to PNG
The last section in the Export to PNG Image dialogue box is the option to export a custom area of your composition. Here, all of the same rules apply from the other settings (x0 and y0 are your starting coordinates, x1 and y1 are your ending coordinates, and the Width and Height will be the total size of your composition).
The main difference here is that the area you set using these values will be the area exported – regardless of whether or not there is a drawing in that area. So, it is almost like setting a crop since you are cropping out anything outside of the values you set.
To demonstrate this setting in action, I will set the x0 and y0 values to 250, and my x1 and y1 values to 1250. This will create an image with a Width and Height of 1000 pixels. I’ll change the name of the image to “Isometric Phone Custom Area” and will click “Export.”
My final composition will be a 1000 x 1000 pixel square, with parts of the design cutoff wherever the design was outside of the export area.