Files
effectcraft/crates/svg
Elias ed5c3685e7 SVG: rasterise each shape within its own bounds
Every fill and stroke allocated a coverage mask the size of the whole canvas and painted every
canvas pixel, so a vector file cost shapes × canvas area: SceneYard "Retro Desktop Movie
Popups" spent 556 s per frame on one 4001×2501 Illustrator layer (568 s a frame in all).

Each shape now rasterises and paints only inside its device-space bounding box (+1 px of
anti-aliasing) clipped to the canvas; a stroke uses the bounds of its outline. The frame
renders in 5–7 s (bench, no cache). Pixels match the whole-canvas version except a few
anti-aliased edge pixels (float rounding of the re-based transform). A test checks that every
pixel a shape covers lies inside its rectangle, and pins the output.

(cherry picked from commit 58d369b5044bf03698f0fae6915843c3d400b1d1)

(cherry picked from commit 7fdbbc5188ab5d420448f47a726bee6a046e6936)
(cherry picked from commit 5efd7aa000874a3a150abd808c7bce158b713535)
2026-10-11 11:50:13 +00:00
..

effectcraft-svg

SVG import for EffectCraft: .svg files import as footage (rasterised at any scale, so Continuously Rasterize stays sharp) and Layer ▸ Create ▸ Create Shapes from Vector Layer turns them into editable shape layers.

Implemented from the W3C Scalable Vector Graphics (SVG) 1.1 (Second Edition) recommendation (16 August 2011) and the SVG 2 candidate recommendation (4 October 2018) for the parts listed here, plus CSS Color Module Level 3 for colour keywords and functions:

  • document: svg (width/height, viewBox, preserveAspectRatio), nested svg, g, defs, use (x/y, href / xlink:href), symbol (through use), title/desc/metadata ignored;
  • shapes: path (all path data commands incl. elliptical arcs), rect (rx/ry), circle, ellipse, line, polyline, polygon;
  • transform lists (matrix, translate, scale, rotate with centre, skewX, skewY);
  • painting: fill, fill-rule, fill-opacity, stroke, stroke-width, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-dasharray, stroke-dashoffset, stroke-opacity, opacity, display, visibility, color/currentColor;
  • linearGradient and radialGradient (with fx/fy focal point), gradientUnits, gradientTransform, spreadMethod, href inheritance of stops and attributes;
  • styling through presentation attributes, the style attribute and <style> sheets with type, class, id and universal selectors (simple selectors and selector lists).

Not supported (ignored): text, images, filters, clip paths, masks, patterns, markers, animation. XML parsing uses roxmltree (MIT/Apache-2.0). Test fixtures are original work (see tests/fixtures/*.attribution).