diag-vectorizer
Raster diagrams back into editable draw.io
Takes a PNG or JPG of a diagram and reconstructs an editable vector version of it — both .drawio and Mermaid. Computer vision finds the geometry (shapes, coordinates, nesting, lines); a multimodal LLM supplies the semantics (text, arrows, colors).
More about it
Two interchangeable detectors sit behind one interface: a classic OpenCV pipeline (adaptive threshold or Canny → morphology → findContours, then shape classification by circularity, fill ratio, aspect and corner angles) and Segment Anything. Detected regions are arranged into a containment tree, and only then does the LLM get involved — for OCR, connections and styles, with its answers cached.
It recognizes rectangles, circles, ellipses, diamonds, triangles, cylinders (database icons) and arrows, along with labels, styles and background colors. Still a work in progress: neither of the diagrams in the post below was touched up before publishing.