SVG-to-PNG Renderer

Phase 1: XML parsing, DOM normalization and attribute extraction

Implement robust SVG parsing and internal object model.

  • Parse XML structure
  • Normalize coordinates/units
  • Extract shared attributes

Functional Output: Parsed SVG converted into a validated internal scene graph.


Phase 2: Rendering engine architecture and raster buffer setup

Design pixel buffer, coordinate system, color handling and drawing primitives.

  • Allocate raster buffer
  • Implement transforms
  • Manage stroke/fill logic

Functional Output: Engine capable of drawing simple primitives onto a raw pixel buffer.


Phase 3: Rectangle, Circle and Ellipse rendering

Add full geometric rasterization for basic shapes with fill + stroke.

  • Implement rectangle raster
  • Implement circle/ellipse raster
  • Respect opacity, stroke width

Functional Output: All three shapes correctly rendered to PNG with accurate geometry.


Phase 4: Line and Polyline rendering

Implement consistent line drawing with joins, caps and polyline sequencing.

  • Add line rasterization
  • Add polyline vertex iteration
  • Handle stroke styles

Functional Output: Lines and polylines rendered with correct thickness and vertex connectivity.


Phase 5: Path parsing and rendering

Support complex Bézier curves, arcs and path commands.

  • Parse all path commands
  • Approximate curves
  • Render filled/stroked paths

Functional Output: Arbitrary paths drawn correctly, including curves and closed regions.


Phase 6: Advanced features, PNG export and validation toolkit

Add transformations, clipping, layered rendering and export pipeline.

  • Apply transforms per element
  • Implement clipping regions
  • Encode PNG file

Functional Output: Complete SVG scenes rendered to correct PNG output with full tested pipeline.