Convert poly vertex color to texture?

Is there any way to export an objects vertex color as a texture map in MEL or python? Then to import a texture and apply it to the vertex color?
you can achieve this manually by going to color>paintVertexColorTool under the tool settings in attribute maps there are import and export options. When I do this manually with echo all commands, I get this:

artExportMapDialog "artAttrPaintVertexCtx";

np_getPrimaryProjectFileRules 0;

// Result: Scenes scene scenes Templates templates data Images images ../3dData/renders Source Images sourceImages textures Render Data renderData Particles particles data/particles Clips clips data/clips Sound sound Scripts scripts Disk Cache diskCache data Movies movie Translator Data translatorData AutoSave autoSave //

waitCursor -state on;

print("Saved file: " + "/home/xxxxxxxxx/Desktop/test12.iff" + "\n");

Saved file: /home/xxxxxxxxxxxx/Desktop/test12.iff

waitCursor -state off;

The only useful command I glean from that is: "artExportMapDialog "artAttrPaintVertexCtx";"

which doesn't help much because the only argument you can seem to give it is the name of a maya tool's context. Any ideas?