Convert fig files to png using Ghostscript and Imagemagick

John Peck
Published , updated

The venerable xfig is still a nice vector drawing program with a clean user interface. Using ghostscript to convert its eps output to png allows setting the conversion resolution explicitly. The script below takes two arguments: the maximum dimension of the finished png in pixels, and the input fig file.