While browsing freshmeat.net, I ran across mesh2hmap. While I haven't personally tested the software, from the description on the website, it seems likely that the pgm output from mesh2hmap would be useful with image2gcode for emc2: mesh2hmap is a simple command line tool for converting 3D meshes to raster heightmaps. This tool allows you to create terrains in your favourite 3D modeller and then easily convert to a heightmap.

Currently mesh2hmap reads only VRML meshes (1 and 2) and outputs a portable grey map (PGM) or portable pixel map (PPM). A PPM is output only when a colour gradient heightmap has been specified.
(originally posted on the AXIS blog)