Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
diagram code

How to Convert Diagram Code to an Image

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use the renderer that understands your diagram’s source language: Mermaid code goes to Mermaid CLI (mmdc), PlantUML source to PlantUML’s Java command line, and DOT source to Graphviz’s dot command. Choose SVG when you need crisp scaling, PNG when you need a broadly compatible image, or PDF for a document or report.

Identify the diagram language first

Diagram source is not interchangeable: a renderer needs to understand the syntax in the file. Check the first few lines, the file extension, or the editor where the diagram was created. Common clues are Mermaid declarations such as flowchart or sequenceDiagram, PlantUML’s @startuml and @enduml markers, and DOT statements such as digraph or graph.

Source Renderer Typical command Good first format
Mermaid definition Mermaid CLI mmdc -i input.mmd -o output.svg SVG or PNG
PlantUML source PlantUML Java archive java -jar plantuml.jar -t svg diagram.puml PNG by default; SVG or PDF when needed
DOT source Graphviz dot dot -Tsvg input.dot > output.svg SVG or PNG
Mermaid diagram in a hosted editor Mermaid Chart Use the editor’s export controls PNG, SVG, or PDF

If you only have an image or a webpage displaying a diagram, these source-code renderers are not the first step: they render diagram definitions, not arbitrary screenshots. For code, match the syntax to a renderer before changing file extensions; renaming a DOT file to .mmd, for example, does not convert its contents.

Choose an output format

SVG for scaling and reuse

SVG is a vector format and can scale without the pixelation associated with enlarging a raster image. It is a strong choice for web pages, documentation, and print workflows that accept SVG. Mermaid CLI and PlantUML can produce it, and Graphviz selects it with -Tsvg.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Wacom Intuos Small, Wired Graphic Drawing Tablet with Pen + Software
  • Wacom Intuos Small Graphics Drawing Tablet: Enjoy industry leading tablet performance in superior control and precision with Wacom's EMR, battery free technology that feels like pen on paper
  • Works With All Software: Wacom Intuos tablet can be used in any software program to explore new facets of digital creativity; draw, paint, edit photos/videos, create designs, and mark up documents
  • What the Professionals Use: Wacom's industry leading pen technology and pen to paper feeling makes it the preferred drawing tablet of professional graphic designers
  • Software and Training Included: Only Wacom gives you software with every purchase. Register your Intuos tablet and gain access to some of the best creative software and Wacom's online training
  • Wacom is the Global Leader in Drawing Tablet and Displays: For over 40 years in pen display and tablet market, you can trust that Wacom to help you bring your vision, ideas and creativity to life

PNG for broad compatibility

PNG is a practical choice when you need a conventional image for a presentation, document, or application that does not handle SVG. Mermaid CLI can write PNG by using a .png output filename; PlantUML uses PNG by default; Graphviz selects it with -Tpng. PNG is raster-based, so choose adequate dimensions if the image will be enlarged.

PDF for reports and handoff

Use PDF when the deliverable is a report or a document that should preserve a page-oriented layout. Mermaid CLI and PlantUML support PDF output. Mermaid Chart’s export guide also describes PDF as an option for reports. Check the result at the intended page size: a diagram that is legible on screen can become too small if it is placed on a page without adjusting its layout.

Convert Mermaid code with Mermaid CLI

Mermaid CLI takes a Mermaid definition file and generates SVG, PNG, or PDF. Install the CLI with npm, then pass the source file with -i and the destination filename with -o.

  1. Install the package: npm install -g @mermaid-js/mermaid-cli.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  2. Save the Mermaid definition as input.mmd.

  3. Render to SVG: mmdc -i input.mmd -o output.svg.

  4. For PNG instead, run: mmdc -i input.mmd -o output.png.

For example, if flow.mmd contains a valid Mermaid flowchart, mmdc -i flow.mmd -o flow.svg creates an SVG output. The output extension is the key format choice in these examples. The CLI also supports themes and transparent PNG backgrounds; for example, mmdc -i input.mmd -o output.png -t dark -b transparent selects the dark theme and a transparent background.

Export PlantUML as an image

PlantUML runs from its Java archive. If you have a local plantuml.jar and Java available, pass one or more source files to the archive. PNG is the default output; add -t to select SVG or PDF.

Rank #2
Drawing Tablet XPPen StarG640 Digital Graphic Tablet 6x4 Inch Art Tablet with Battery-Free Stylus Pen Tablet for Mac, Windows and Chromebook (Drawing/E-Learning/Remote-Working)
  • Battery-Free Pen: StarG640 drawing tablet is the perfect replacement for a traditional mouse! The XPPen advanced Battery-free PN01 stylus does not require charging, allowing for constant uninterrupted Draw and Play, making lines flow quicker and smoother, enhancing overall performance
  • Ideal for Online Education: XPPen G640 graphics tablet is designed for digital drawing, painting, sketching, E-signatures, online teaching, remote work, photo editing, it's compatible with Microsoft Office apps like Word, PowerPoint, OneNote, Zoom, Xsplit etc. Works perfect than a mouse, visually present your handwritten notes, signatures precisely
  • Compact and Portable: The G640 art tablet is only 2 mm thick, it's as slim as all primary level graphic tablets, allowing you to carry it with you on the go
  • Chromebook Supported: XPPen G640 digital drawing tablet is ready to work seamlessly with Chromebook devices now, so you can create information-rich content and collaborate with teachers and classmates on Google Jamboard’s whiteboard; Take notes quickly and conveniently with Google Keep, and effortlessly sketch diagrams with the Google Canvas
  • Multipurpose Use: Designed for playing OSU! Game, digital drawing, painting, sketch, sign documents digitally, this writing tablet also compatible with Microsoft Office programs like Word, PowerPoint, OneNote and more. Create mind-maps, draw diagrams or take notes as replacement for mouse
  1. Render a PlantUML source file with the default PNG output: java -jar plantuml.jar diagram.puml.

    What’s actually slowing this PC down?

    Pick the symptom - the matching free tool is one click away.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  2. Choose SVG explicitly: java -jar plantuml.jar -t svg diagram.puml.

  3. Choose PDF for a report workflow: java -jar plantuml.jar -t pdf diagram.puml.

The command-line tool can process directories and common PlantUML source extensions, so it also fits batch rendering. Start with one file and confirm its output before using a directory-wide command; that makes it easier to spot a malformed source file or an unexpected output location.

Turn DOT source into SVG or PNG with Graphviz

Graphviz’s dot command reads DOT files or standard input. The -T flag selects the output format, and shell redirection writes the rendered bytes to a file.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Render a file as SVG: dot -Tsvg input.dot > output.svg.

  2. Render the same source as PNG: dot -Tpng input.dot > output.png.

    Rank #3
    UGEE M708 Drawing Tablet, 10x6 inch Large Space for Digital Drawing
    • Large Active Drawing Space: UGEE M708 V3 graphic drawing tablet features 10 x 6 inch large active drawing space with papery texture surface, provides enormous and smooth drawing for your digital artwork creation, offers no-lag sketch and painting experience
    • 16384 Passive Stylus Technology: A more affordable passive stylus technology offers 16384 levels of pressure sensitivity allows you to draw accurate lines of any weight and opacity according to the pressure you apply to the pen, sharper line with light pressure and thick line with hard pressure for artistry design or unique brush effect for photo retouching
    • Compatible with Multiple System and Softwares: Powerful compatibility, tablet for drawing computer, perform well with Windows 11/10/8/7, Mac OS X 10.10 or later, Android 10.0 or later, mac OS 10.12 or later, Chrome OS 88 or later and Linux; Driver program works with creative software such as Photoshop, Illustrator, Macromedia Flash, Comic Studio, SAI, Infinite Stratos, 3D MAX, Autodesk MAYA, Pixologic ZBrush and more
    • Ergonomically Designed Shortcuts: 8 customizable express keys on the side for short cuts like eraser, zoom in and out, scrolling and undo, provide a lot more for convenience and helps to improve the productivity and efficiency when creating with the drawing tablet
    • Easy Connectivity for Beginners: The UGEE M708 V3 offers USB to USB-C connectivity, plus adapters for USB C, ensuring easy connection to various devices and allowing beginner artists to set up quickly and focus on their creativity without compatibility concerns; Whether using a laptop, desktop, chromebook, or tablet, the UGEE M708 V3 provides a seamless experience for those just starting their digital art journey
  3. Or pipe DOT text directly to Graphviz: echo 'digraph { a -> b }' | dot -Tsvg > output.svg.

In the final example, the shell’s > writes the output file; it is not part of DOT syntax. Use single quotes around the inline definition so the shell passes it as one string. For larger diagrams or scripts, a source file is easier to edit and review.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use a hosted Mermaid editor if you do not want a local CLI

Mermaid Chart provides a browser-based workflow for exporting a finished Mermaid diagram. Use its export controls to choose PNG, SVG, or PDF. This is convenient when you want to edit or export in a hosted editor rather than install and run a local renderer. It is a digital service, not a physical product.

For repeatable builds, the command-line route is usually easier to incorporate into a shell script or documentation build: Mermaid CLI, PlantUML, and Graphviz all support command-line rendering. For an occasional export where a hosted editor is preferable, Mermaid Chart offers the browser workflow. Choose based on how the diagram is authored and where the result needs to go, rather than on format alone.

Automate repeatable exports

Once the source file renders correctly, the same command can be used in a script or CI job. Keep the source and output names explicit, and choose the format in the command rather than relying on someone to export manually from an editor. Mermaid CLI’s input and output flags, PlantUML’s Java invocation, and Graphviz’s format flag make these workflows suitable for repeatable documentation builds.

  • Keep the source definition in the project so an image can be regenerated after edits.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Use a stable output filename, such as architecture.svg, when a document or page refers to it.

    Rank #4
    Sale
    HUION Inspiroy H1060P Graphics Drawing Tablet, 10 x 6.25 in, 12+16 Hot Keys
    • Working Area Configuration - HUION art tablet equips with a 10 x 6.25 inches working area, providing the user with the most comfortable size to work; the 10mm slim structure and minimalist design of appearance make the drawing tablet more attractive.
    • Tilt Function Battery-free Stylus: This computer graphics tablet come with a battery-free stylus PW100, no need to charge, allowing for constant uninterrupted drawing. ±60° tilt support enables imitation of lines input with diverse drawing gestures, with accuracy ensured.
    • Press Keys:12 programmable press keys plus 16 programmable soft keys, you can set shortcut keys on drawing tablet's driver based on your preferences, such as erase, zoom in/out, scroll up and down, and so on.
    • Compatibility: HUION graphics tablet supports Windows 7 or later/ macOS 10.12 or later/ Android 6.0 or later/ Linux (Ubuntu). A USB adapter is required to connect to a Mac computer. H1060P supports various mainstream design and drawing software, including PS, SAI, AI, CDR, etc. (Please note: The H1060P is compatible with Ubuntu, but it requires the use of the Xorg display server. Wayland is not supported.)
    • NOTE: You can easily connect your phone to the art tablet via the OTG connector; while iPhone and iPad are NOT at the moment. The cursor will not show up in the SAMSUNG Galaxy S series at present. If you are not sure whether the product is compatible with your Phone or any help, please contact us.
  • Render to the format the consuming tool actually supports; SVG may be a good default for web use, while PNG may be simpler for software that expects raster images.

  • When a build fails, inspect the renderer’s diagnostic output and the source syntax before treating the result as an image-format problem.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot common conversion problems

The command is not found

If the shell reports that mmdc or dot is not found, the relevant CLI may not be installed or may not be on the shell’s executable path. For PlantUML, check that the Java command works and that the path to plantuml.jar is correct. Run the command from the directory containing the source file, or provide its full path.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The renderer rejects the source

Confirm that the source language matches the renderer: Mermaid definitions need Mermaid CLI, PlantUML syntax needs PlantUML, and DOT syntax needs Graphviz. Then inspect the reported line or nearby delimiters and punctuation. A file extension can help you identify a file, but it does not change the language the contents are written in.

The output is not the format you expected

Check the output name and format selector. Mermaid CLI’s examples use the output extension, PlantUML defaults to PNG unless you pass -t, and Graphviz uses -Tsvg or -Tpng. Do not assume all three tools choose formats the same way.

The result looks jagged or will not open

If you enlarged a PNG, try SVG where the destination supports it, or render a PNG at dimensions appropriate for its final placement. If a viewer does not accept SVG, use PNG or PDF as appropriate. When a file cannot be opened, verify that the command completed successfully and that the output file contains the rendered result rather than an error message redirected into it.

The diagram appears too small in a PDF or presentation

Check the intended page or slide size and the diagram’s layout before exporting again. Changing the format does not automatically make a crowded diagram readable. Use a vector output for scaling when supported, and inspect the actual placement in the destination document.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Drawing Tablet XPPen G430S OSU, Graphic Drawing Tablet with 8192 Levels Pressure Battery-Free Stylus, 4 x 3 inch Ultrathin, for OSU Game, Online Teaching Compatible with Window/Mac Black
  • Ultra thin tablet: Active Area 4 x 3 inches. Fully utilizing our 8192 levels of pen pressure sensitivity―Providing you with groundbreaking control and fluidity to expand your creative output. Please note: The 4 x 3 inches is very small, please confirm that it will meet your needs before you purchase it
  • OSU game: Designed for OSU! gameplay, drawing, painting, sketching, E-signatures etc. No need to install drivers for OSU! It's also designed for both right and left hand users
  • Accurate Pen Performance: StarG430S computer graphics tablet is the perfect replacement for a traditional mouse! The XPPen advanced Battery-free PN01 stylus does not require charging, allowing for constant uninterrupted Draw and Play, making lines flow quicker and smoother, enhancing overall performance
  • Compact and Portable: The G430S art tablet is only 2 mm thick, it’s as slim as all primary level graphic tablets,Ultra-thin and portable, allowing you hold it in one hand and carry it on the go. This graphic drawing tablet supports Mac. However, since the product interface is micro USB to USB-A, if your computer is a Mac and does not have a USB-A port, you will need to purchase an OTG transfer adapter to ensure compatibility with your Mac. So please confirm your computer port before you purchase it
  • PLEASE NOTE: The XPPen StarG 430 is compatible with the Windows system 11/10/8/7(32/64 bit), and the Mac OS X version 10.10 or later, but it is incompatible with iOS and iPad OS. If your computer is a Mac, you need to grant permission to the Mac preferences first. Please go to our official website, and according to the guide: XPPen>Support>FAQ, find out the Star G430 and click, then click the question according to your Mac system. There are detailed guidelines for installing the driver so your tablet will work correctly. It's possible incompatible with the customer's own EMR system or other signature system. Please feel free to contact us to confirm the compatibility before your purchase

Or skip the browser setup

ScreenshotNeo is for capturing a rendered webpage, not for converting Mermaid, PlantUML, or DOT source code directly. If your diagram is already displayed on a webpage and you need a screenshot of that page, its website screenshot API can return an image or PDF with one GET request. See the ScreenshotNeo API documentation.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

With a URL in place, the same call in Python is:

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Or in Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

Sign up for ScreenshotNeo’s free plan to try it with 1,000 screenshots a month and no card.

Cost and reliability considerations

Local command-line rendering puts the conversion in your own environment and can be repeated without a browser-based export step. It also means your build depends on having the matching renderer available: Mermaid CLI for Mermaid, Java and PlantUML for PlantUML, or Graphviz for DOT. If you choose a hosted editor, you trade local setup for a browser-based service workflow. The supplied tools support repeatable rendering, but the source material does not establish comparative rendering speed or reliability figures, so choose using your syntax, output needs, and environment rather than an assumed performance ranking.

For ScreenshotNeo, treat the API as a webpage-capture step only after the diagram has been rendered and published somewhere accessible by URL. It is not a substitute for the syntax-specific commands above. Its billing behavior distinguishes billable clean captures from the non-billed conditions listed in the response, which can help when automating screenshot capture of finished diagrams.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Can I convert Mermaid, PlantUML, and DOT source with the same command?

No. Each renderer understands its own diagram language: use Mermaid CLI, PlantUML’s Java command line, or Graphviz’s dot for the matching source.

Does ScreenshotNeo turn Mermaid code directly into an image?

No. ScreenshotNeo captures webpages by URL. Render the diagram with its language-specific tool first; ScreenshotNeo can capture it if it is displayed on an accessible webpage.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Read next

Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.