Skip to content

Excalidraw 2.3.0: image options, rename conversion, new image files - #80

Merged
nwparker merged 2 commits into
mainfrom
nwparker/excalidraw-image-parity
Nov 8, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/excalidraw-image-parity

Conversation

@nwparker

@nwparker nwparker commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

What changed

Follow-up to #79 (issue #77). This brings image editing up to the Excalidraw VS Code extension's "Edit Images" feature, and goes further in places.

VS Code extension Orca 2.2.0 This PR (2.3.0)
Open/save .excalidraw.svg / .png yes yes yes
Keep an existing file's scale, background and dark mode no: one global setting is applied on every save yes yes, and a PNG reopens exactly
Change the export look global setting only no per file, from the main menu; new images use the last look picked
Rename .excalidraw ↔ .excalidraw.svg / .png to convert yes no (error) yes: .excalidraw → svg/png, and svg → png
New image file from the menu yes no (empty file only) "New Excalidraw SVG image" / "New Excalidraw PNG image"
  • Picture in this file (main menu, image editors only): Scale (1×/2×/3×), Background and Dark mode. Changing one redraws the picture and marks the tab as changed. The menu stays open, so several options can be set in a row. The last look picked is kept in the frame's localStorage, the same place as the library, and new or converted pictures start with it. I used the menu instead of an Orca setting so the plugin doesn't need a new capability (settings:own), which would make every user approve the plugin again.
  • The PNG records its look. A second tEXt chunk, orca-excalidraw-look, holds {scale, background, dark}. It sits after the scene chunk, and Excalidraw reads only the first tEXt. With it, reopening no longer depends on guessing from pixels. Excalidraw's own PNG exports still use the pixel check, and the menu can now correct a wrong guess.
  • Rename conversion. A file whose content is in a different Excalidraw format than its extension says opens as its scene, with image: null, stale: true. picture-sync draws it on attach, so the tab turns dirty and the next save writes the new format. An SVG renamed to PNG keeps its look.
  • A merge keeps a look picked on this canvas.
  • Docs updated in README.md and build/README.md. Catalog 2.3.0 entry generated with scripts/release-entry.mjs --write.

Verification

  • npm test: 26/26 pass. New tests cover rename decoding (JSON→svg, JSON→png, svg→png with its look), drawing on attach and saving the converted file, the PNG look chunk round trip (Excalidraw's first-tEXt reader still finds the scene), and a look surviving a merge.
  • node build.mjs: rebuilt editor/.
  • Playwright against the built editor/ with a fake Orca document session: 14/14 checks pass. Covered:
    • JSON renamed to .svg and to .png is drawn and embedded.
    • Menu changes restyle the picture (scale 2, dark), and the menu stays open between picks.
    • A new PNG picks up the remembered look.
    • Turning the background off works.
    • Reopening a saved PNG sends no edit, and the menu reads its recorded look.
    • SVG→PNG keeps the look.
    • No page errors.
  • orca plugin validate and orca plugin check: valid. The only warnings are the same 4 editor_eval warnings (from bundled Excalidraw code) as on main.
  • ORCA_DIR=<orca@81ec82b> node scripts/release-entry.mjs: ok. scripts/check-catalog.mjs: catalog: ok.

Execution profile (for anything above data, say why it is needed)

sandboxed-ui, the same as 2.2.0. It adds no capabilities, permissions or network access.

🤖 Generated with Claude Code

Brings image editing to parity with the Excalidraw VS Code extension
(https://github.com/excalidraw/excalidraw-vscode#edit-images):

- "Picture in this file" in the main menu sets an image's scale,
  background and dark mode, per file; new images start with the last
  look picked. VS Code only has one global setting.
- A PNG notes its look in an `orca-excalidraw-look` tEXt chunk after the
  scene, so it reopens exactly; Excalidraw ignores it.
- Renaming .excalidraw to .excalidraw.svg/.png, or .svg to .png, opens the
  scene, draws the picture (tab turns dirty) and saves the new format.
- "New Excalidraw SVG image" and "New Excalidraw PNG image".
@nwparker
nwparker merged commit 4589eb9 into main Nov 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant