Reproduce a diagram from a picture
Goal
Recreate a diagram that exists only as an image, as real model content in EA, and measure how closely the result matches the picture. For an architect. You end with a diagram of real elements and connectors, placed at coordinates read from the image, and a fidelity report that says what matches, what does not, and what was never read.
Where it runs
This scenario needs the MCP server and local code execution. Computer use covers its UI steps.
| Surface | How it runs |
|---|---|
| Claude Code | Fully |
| Claude Cowork | Not available. The scenario needs local code execution on the machine where EA runs, and a local Claude Cowork session runs code in an isolated virtual machine instead. A cloud session has no local MCP server. |
| Claude Desktop chat | Not available. The scenario needs local code execution, which Claude Desktop chat does not have. |
| VS Code with GitHub Copilot | Fully, except the UI steps, which you perform: starting EA and opening the model, and dismissing any dialog EA raises (you paste a screenshot of it into the conversation first). |
Before you start
- The start-of-session check done.
- The picture, in a form the AI can look at, and the right to reproduce it. The AI reads the picture itself; the server's only file import is XMI.
- A decision about what each shape is. A rectangle is not a class because it is a rectangle: geometry cannot tell the AI what a shape means, so you confirm the mapping.
- A target package and, for existing content, a baseline.
- Local code execution, because the comparison with the picture is a code engine (Composition engine). Without it the scenario is not available.
Sometimes the only thing that survives of a diagram is a picture: one drawn in another tool, an exported slide, a screenshot. The aim is to produce, in EA, a diagram that looks essentially the same, made of real model content and not of drawing shapes.
The method is that the AI looks at the picture and reads off what is on it and where. The AI reads the picture directly, so a PNG, an SVG, a screenshot and a slide export are the same job. The placement operations take explicit coordinates, so the work is the reading and the check. A diagram can lint perfectly and not resemble its reference at all. The linter judges a diagram against itself. A reproduction is judged against its reference, and the two judgments disagree. A hand-placed original has boxes a few units out of alignment and irregular gaps. Fixing those produces a tidier diagram that is no longer the one you were asked to reproduce. So a faithful transcription is not required to lint clean.
Steps
- AI with computer use; otherwise you If EA is not running or the model is not open, start EA and open it. You Decide how the picture was made, when it is unclear. The way the original was made decides the method, and choosing wrongly is the actual failure. A reference that follows a rule is composed from a grammar (Compose a diagram). One that looks laid out by EA's own automatic layout is reproduced by running the layout and tidying. One a human placed by hand is reproduced by transcribing the coordinates from the picture. Running automatic layout on a hand-placed reference produces a diagram that is structurally right and visibly not the sample. None of the three means "cannot".
- AI
ea-diagram-compositionreads the picture into a reading: each element's name and rectangle in image coordinates, the links between them, a precision (the reading's own uncertainty in pixels, which is the tolerance), and a list of what was deliberately not read. A reading that cannot be made precisely must say so by declaring a larger precision. A reading may be partial. It may not be partial silently: each omission comes out of the comparison as an unanswered question, and a "faithful" verdict says nothing about it. - AI
ea-diagram-compositionandea-modelingmap each shape to a model element, and create them in bulk. The AI proposes what each shape is (a component, an actor, a note). You Approve what each shape is before anything is created. - AI Power Tools
ea-diagram-compositionplaces the elements at the read coordinates, with no automatic layout, and each placed object states which reference element it stands for. Correspondence is declared, never guessed from names, because in a reproduction the names often change by design. - AI Power Tools
ea-diagram-compositionstyles to match. - AI Power Tools
ea-diagram-compositionverifies by render. - Engine
ea-diagram-compositioncompares with the reading. It fits one uniform scale and offset between the two, so a diagram drawn at twice the size, or shifted across the canvas, is the same diagram. Scale is reported as a number. It does not fit rotation, and it reports stretching as aspect-distorted. It then judges: inventory (missing and extra elements), ordering, placement drift, sizing, links, features, content and fill. An unmatched element on either side is a finding, never a skipped comparison. The report is faithful when it holds no errors. Warnings are differences a reader might notice. A difference larger than the reading's own precision is a real difference: a warning up to three times the precision, and an error beyond that. - AI Power Tools
ea-diagram-compositioniterates, a bounded number of times, adjusting placements and repeating steps 6 and 7. - You Compare by eye. The measurement is only as good as the reading. Look at the two side by side and decide whether it is essentially the same.
Prompts to use
Opening
Follow-ups
Recommended models
| Model | Fit | Why |
|---|---|---|
| Claude Fable 5.1 | Recommended | Reads geometry off an image, and judges what a shape means |
| Claude Opus 5.5 | Recommended | The same |
| Claude Sonnet 5.5 | Capable | Reads simpler pictures well. Check its coordinates against the comparison |
| Claude Haiku 4.5 | Not recommended | Reading coordinates from an image to a few pixels is the hard part |
Ratings are guidance based on the kind of reasoning the skill needs, not measured benchmarks.
Checking the result
- Accurate. The fidelity report is faithful, with the scale it fitted stated. The worst position and size drift are within the reading's precision. Each shape is mapped to an element type you approved.
- Complete. The report's inventory shows no missing or extra elements, or says why. Every link in the reading is present. Everything the reading did not cover is listed to you, so that nobody takes "faithful" to mean "complete".
- Nothing unintended changed. Only the new diagram and its elements are added. A baseline comparison shows nothing else moved.
Variations
- Part of a diagram. A partial reading with a stated list of what was not read is legitimate.
- A rule-following picture. If the original follows a grammar, compose it instead. It will lint clean, and it needs no reading.
- A reference from another tool at higher precision. Declare the smaller precision and the checks tighten together.
Limitations
- An example result. In one live check, a cloud pattern's render against its reading was faithful: scale 0.9995, worst position drift 0.7 pixels and worst size drift 2.0 pixels against a precision of 4.
- Judge by a render, not by stored geometry. In that check, EA drew three of thirteen elements 26 to 34 pixels away from their stored rectangles, so a comparison of stored geometry would have called a faithful reproduction drifted. The comparison to use for a faithful judgment is on a render.
- Artwork, captions and logos are outside the reading. They are separate work (Draw a cloud architecture diagram with vendor icons).
- Semantic lifting needs you. AI Power Tools cannot tell what a shape means from its geometry.
- Third-party pictures may be copyrighted. Reproducing one is your decision to make.