I would simply write a macro that would import the OMML into a OOo/AOO/LibreOffice drawing and export that to png, for example.
There are plenty of examples online on how to use OpenOffice Macros with filters.
You can run an openoffice macro from the command line.
Something like this, I do not have the time to look into it more, sorry ...
Sub Macro1(outfile, formula)
' Create a drawing.
oDoc = StarDesktop.loadComponentFromURL( "private:factory/sdraw", "_blank", 0, Array() )
' Get the first page.
oDrawPage = oDoc.getDrawPages().getByIndex( 0 )
' Input and output files - to be converted to URL's
iURL = ConvertToURL(formula)
oURL = ConvertToURL(outfile)
' Get a position in the drawing (not sure this works in draw, it does in writer)
set oViewCursor = objDocument.CurrentController.getViewCursor()
set oTextCursor = objDocument.Text.createTextCursorByRange(oViewCursor.getStart())
'insert formula
oTextCursor.InsertDocumentFromURL iFile, Array()
' Save the document using a filter.
oDoc.storeToURL(oURL, Array(MakePropertyValue("FilterName", "draw_png_Export"), ))
End Sub
To run that from the command line, use the following:
sdraw -invisible "macro:///Standard.Module1.ConvertWordToPDF('c:\formula.odf', 'c:\image.png')"
Regards,
HP