Skip to content

Canvas mode: export annotations as SVG/vector package #27

@lidge-jun

Description

@lidge-jun

Source

Canvas Mode follow-up from devlog/_plan/0.24-canvas-mode/FOLLOW-UP-ISSUES.md and parent issue #22.

Goal

Add a Canvas export option that produces an SVG/vector package for the current canvas composition.

Scope

This first version should vectorize the annotation layer, not perform true raster image tracing.

  • Embed the source image as an SVG <image> element.
  • Render Canvas annotations as SVG elements:
    • pen/freehand/arrow paths -> <path>
    • boxes -> <rect>
    • memos -> <text> or grouped text elements
  • Use the source image natural dimensions as the SVG viewport.
  • Map normalized annotation coordinates into SVG pixel units.
  • Export should not mutate canvas state or create a canvas version file.

Out of scope

  • True AI/raster vectorization of the generated image.
  • Potrace-like bitmap tracing.
  • Editable SVG import back into Canvas Mode.
  • Server-side file writes.

Acceptance criteria

  • Canvas toolbar exposes an SVG export action.
  • SVG contains the source image plus vector annotation overlays.
  • Pen, arrow, box, and memo positions match PNG export visually.
  • SVG export works for unsaved local annotations.
  • Export path does not expose raw local filesystem paths.
  • Tests cover SVG dimensions, embedded image behavior, annotation element generation, and no state mutation.

Notes

If true raster vectorization is desired later, track it as a separate issue. Generated raster images are unlikely to vectorize cleanly without a dedicated tracing pipeline and UX warnings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions