Skip to main content
Built by Best ROI MediaMITWave 4 · LiveBestRoiMedia/bestroi-game-tools

Illustrator SVG Import

Hash-verified SVG normalizer that strips Adobe Illustrator private PGF payloads without altering visible geometry.

Single-purpose SVG sanitizer that removes embedded Illustrator private data (aipgf, pgf, foreignObject) and normalizes unambiguous switch nodes while proving visible geometry is SHA-256 identical.

View on GitHub ↗
Quick clonegit clone https://github.com/BestRoiMedia/bestroi-game-tools.git
GitHub repositoryBestRoiMedia/bestroi-game-tools
Module path_tools/illustrator/
LicenseMIT
Release waveWave 4
LanguagesPython

Why we built it

Adobe Illustrator embeds private PGF data inside exported SVGs and silently reopens that stale payload instead of edited visible SVG paths. Stripping it safely guarantees downstream tools and Illustrator both read the exact visible artwork.

Architecture & how it works

Computes a canonical SHA-256 hash of all visible SVG elements, attributes, and style text before and after removing private PGF/foreignObject branches, refusing to overwrite the source file or proceed if visible structure changes.

Key capabilities

  • Strips aipgf, aipgfref, pgf, pgfref, and PGF-only foreignObject elements
  • Converts unambiguous single-branch SVG switch elements into standard g groups
  • Cryptographic SHA-256 verification guaranteeing zero change to visible geometry or styles
  • Immutable source protection (refuses in-place or existing-file overwrites) with JSON receipt output

Usage example

Normalize an Illustrator-exported SVG into a clean import copyPython
python3 illustrator/svg_import.py ./artwork.svg --out ./artwork.clean.svg --receipt ./receipt.json
Throws an error if a non-PGF foreignObject or ambiguous switch branch is encountered.