Why wouldn’t you just use Mermaid to generate the PNG directly?
One reason I could think of: Fewer dependencies that need integration
One reason I could think of: Fewer dependencies that need integration