IMG 2 SVG
IMG 2 SVG
Converting raster images to scalable vector graphics using GIMP and Inkscape.
Note: This tutorial assumes a basic working knowledge of computers, image-processing software, downloading files, installing software, and using a mouse. It also assumes GIMP, Inkscape, and a web browser are already installed. A working internet connection is helpful. The versions used for this original walkthrough were GIMP 2.8.14 and Inkscape 0.48.5 r10040 from the Debian Linux testing repository as of 01 March 2015. Ubuntu, Fedora, CentOS, OpenSUSE, Red Hat, macOS, and Windows all have packages or installers for GIMP and Inkscape. Your mileage may vary.
In this example, I used a PNG from the Wikipedia article on the Futurama character Bender: Bender (Futurama).
Launch GIMP
- Open the source image with File > Open.
- Use Colors > Desaturate. I typically use Lightness, but use whatever works best for your image.
Note: GIMP only operates on the selected area. A selection can be useful if you want different thresholds in different parts of the image.
- Use Colors > Threshold. You will need to experiment a little, but Auto usually gets close.
- Change the image mode with Image > Mode > Indexed. - Select Black and White 1-bit palette. - Leave Remove unused colors enabled.
- Remove any signature and unwanted artifacts such as speckles. SVG conversion is much easier without stray noise. In this example, I left some speckling under Bender's cigar intentionally.
- Make sure you have permission or legal authority to remove signatures or watermarks, or make sure they get restored in the final image. If needed, you can cut and paste the signature into a separate image for later use.
- Use Image > Zealous Crop. I forgot this step when I made the original walkthrough, so the canvas sizes shown here ended up with a little extra white space.
- Save the working image as a GIMP .xcf for future edits, then export a .png copy with File > Export As.
- I changed the names so I would not overwrite the original.
- Example:
bender.pngbecomesbender.xcfandbender_clean.png. - When exporting, there is no need to save background color, creation time, or transparent pixel color values.
Launch Inkscape
- Open the cleaned image with File > Open > Bender_clean.png.
- Select the image using the arrow tool.
- Go to Path > Trace Bitmap.
- On the Options tab:
- Disable Suppress speckles.
- Enable Smooth corners at 1.00.
- Enable Optimize paths at 5.00.
- On the Mode tab:
- Select the Colors radio button.
- Set Scans to 2.
- Disable Smooth.
- Enable Stack scans.
- Disable Remove background.
- Press Update.
- Press OK. You should now have a vector object on top of the raster object.
- Move the vector object aside, using the select tool if needed.
- Delete the raster object.
- Select the vector object.
- Move the vector object back to the home position using the X,Y coordinates in the toolbar.
- Save as SVG. I typically save as Plain SVG (.svg) rather than an Inkscape SVG if I plan to use the image anywhere outside Inkscape, such as on web pages or in Adobe Illustrator.
- If needed, you can cut and paste the signature raster object from GIMP directly into Inkscape. I copied the signature after desaturating, but before converting from RGB to black and white.
- Save again after any final cleanup.
Advanced topic: coloring the vector afterward
This section was incomplete in the original post, but the main guidance still stands.
If you want to color the image after conversion, the Inkscape fill bucket works somewhat like fill tools in raster image editors, but it may leave a thin white ring between the outline and the filled areas. A simple, if not always ideal, workaround is to break apart the vector paths first.
- Select the Edit Node tool.
- Click the outline vector object.
- Use Path > Break Apart.
- Select the fill bucket tool.
- Choose the fill color.
- Click inside the empty area you want to fill.
Surviving example images
Note: Several step-by-step figure screenshots from the original post were no longer retrievable from their legacy Google-hosted URLs during migration. The tutorial text has been preserved, and the remaining local example images and SVG output are retained below.
Original raster source

Cleaned raster image prepared for tracing
