{"slug": "we-benchmarked-gpt-image-2-6-native-svg-output-path-counts-cost-real-edge-cases", "title": "We Benchmarked GPT-Image-2.6 Native <svg> Output: Path Counts, Cost & Real Edge Cases", "summary": "A developer benchmarked gpt-image-2.6's native output_format: \"svg\" support while building GPTSVG Studio, finding that native LLM-authored SVG geometry produces compact files (0.9 KB to 9.6 KB, 5 to 28 paths) with grouped layers and no embedded raster bitmaps, unlike auto-traced raster output. The benchmark also found native SVG output is restricted to text prompts, with image-edit endpoints rejecting the format, and the developer open-sourced the sample outputs and a zero-dependency TypeScript XML AST sanitizer under MIT, warning that LLM-generated SVG should never be injected via innerHTML.", "body_md": "Most \"AI vector generators\" over the past two years did the exact same thing under the hood: generate a raster PNG, then run an aggressive auto-tracer over it—leaving you with 1,800 jagged `<path>` nodes and muddy gradients that bog down Figma.\n\nWith `gpt-image-2.6` adding native `output_format: \"svg\"` support, we ran a structured benchmark while building [GPTSVG Studio](https://gptsvg.com) to see whether native LLM-authored `<svg>` geometry is actually clean enough for production frontend and brand work.\n\nAll raw `.svg` sample outputs, rendered previews, and our standalone zero-dependency TypeScript XML AST sanitizer are open-sourced under MIT here:\n\n👉 **GitHub Benchmark & Sanitizer Repo**: [https://github.com/keokeo/gpt-image-2-6-svg-benchmark](https://github.com/keokeo/gpt-image-2-6-svg-benchmark)\n\n`<g id=\"...\">` layers—not traced soup`0.9 KB – 9.6 KB`), zero embedded `data:image/png` bitmaps, and readable group IDs:\n| Preset | Quality | Raw Size | Elements / Paths | Embedded Raster |\n\n   | :--- | :--- | :--- | :--- | :--- |\n\n   | Minimal Geometric Logo | `medium` | `1.4 KB` | 6 elements | `0` |\n\n   | Wordmark + Mark | `medium` | `2.1 KB` | 9 elements | `0` |\n\n   | 24×24 Monoline UI Icon | `low` | `0.9 KB` | 5 strokes | `0` |\n\n   | Die-Cut Sticker | `medium` | `9.6 KB` | 28 paths | `0` |\n\n   | Shield / Crest Badge | `low` | `1.9 KB` | 8 paths | `0` |\n\n**Native `output_format: \"svg\"` is strictly Text-to-SVG**\n\nUpstream providers currently restrict native SVG output to text prompts; image-edit endpoints reject `output_format: \"svg\"`. For [Image to SVG conversion](https://gptsvg.com/image-to-svg), we paired a zero-upload client-side Web Worker k-means vectorizer (free, runs 100% locally in your browser) with an optional flat-palette AI redraw pass.\n\n**Never inject LLM-generated SVG with `innerHTML`**\n\nInline `<svg>` is executable XML. Treat model-generated SVG as untrusted input: parse it into an XML AST, rebuild only allow-listed geometry tags/attributes (stripping `<script>`, `<foreignObject>`, `on*` handlers, and external `href` references), serve stored files with `Content-Security-Policy: default-src 'none'; sandbox`, and render previews via `<img src=\"blob:...\">`.\n\nHappy to share raw SVG snippets or sanitizer edge cases if anyone else is building vector tooling!", "url": "https://wpnews.pro/news/we-benchmarked-gpt-image-2-6-native-svg-output-path-counts-cost-real-edge-cases", "canonical_source": "https://dev.to/keokeo/we-benchmarked-gpt-image-26-native-output-path-counts-cost-real-edge-cases-e2a", "published_at": "2026-11-06 08:18:34+00:00", "updated_at": "2026-11-06 08:24:50.434609+00:00", "lang": "en", "topics": ["generative-ai", "ai-tools", "large-language-models", "developer-tools"], "entities": ["gpt-image-2.6", "GPTSVG Studio", "GitHub", "Figma"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/we-benchmarked-gpt-image-2-6-native-svg-output-path-counts-cost-real-edge-cases", "markdown": "https://wpnews.pro/news/we-benchmarked-gpt-image-2-6-native-svg-output-path-counts-cost-real-edge-cases.md", "text": "https://wpnews.pro/news/we-benchmarked-gpt-image-2-6-native-svg-output-path-counts-cost-real-edge-cases.txt", "jsonld": "https://wpnews.pro/news/we-benchmarked-gpt-image-2-6-native-svg-output-path-counts-cost-real-edge-cases.jsonld"}}