December 23, 2008 — Robert Raguet-Schofield, User Interface Group

I’m constantly amazed by the wide variety of tasks people accomplish with Mathematica, everything from serious scientific research and development to fun games and puzzles. This one is more on the fun side.

A few days ago I was trying to convert a raster image to a vector image. I remembered seeing some online service to do this in the past and I was trying to dig up the URL. In the back of my mind I thought I could probably do this with Mathematica, but it wasn’t immediately clear how. I spent a minute or two contemplating various algorithms one could use before realizing Mathematica already has a built-in visualization function that could do most of the work for me: ListContourPlot. This function was meant to handle elevation-like data, but a two-dimensional list of grayscale values is essentially the same thing.

The first step is to get a suitable raster image into Mathematica 7. This is easy enough: just drag a JPEG file into the notebook window and assign it to a variable. Here is a picture of my handlebars after a muddy bike race.

Read More »