Skip to main content

PSD2SVG

PSD to SVG converter based on psd-tools.

PyPI Version Documentation Status

Features

  • Convert PSD files to clean, editable SVG
  • Preserve layers and artboards with smart group optimization
  • Convert text layers to native SVG text elements (experimental)
    • Arc warp support with SVG textPath
    • Smart font matching with Unicode codepoint-based selection
  • Support for most Photoshop blending modes (with approximations for unsupported modes)
  • Adjustment layers support (experimental)
  • Optional font subsetting and embedding for web optimization (typically 90-95% size reduction)
  • Built-in resource limits for security (file size, timeout, layer depth, dimensions)
  • Command-line tool and Python API

Installation

pip install psd2svg

Optional Features

# Browser-based rasterization (better SVG 2.0 support)
pip install psd2svg[browser]
playwright install chromium

Quick Start

Command Line

# Basic conversion
psd2svg input.psd output.svg

# With external images
psd2svg input.psd output.svg --image-prefix images/img

Python API

from psd2svg import convert

# Simple conversion with embedded images
convert('input.psd', 'output.svg')

# With external images
convert('input.psd', 'output.svg', image_prefix='images/img')

Advanced Usage

from psd_tools import PSDImage
from psd2svg import SVGDocument

# Load PSD and create SVG document
psdimage = PSDImage.open("input.psd")
document = SVGDocument.from_psd(psdimage)

# Save with options
document.save("output.svg", embed_images=True)

# Embed and subset fonts for web
document.save("output.svg", embed_fonts=True, font_format="woff2")

# Rasterize to PNG
image = document.rasterize()
image.save('output.png')

Known Limitations

  • Text rendering: Requires matching system fonts; rendering may differ from Photoshop if fonts are unavailable or substituted
  • Text wrapping: Basic support via --text-wrapping-mode foreignobject CLI option or text_wrapping_mode=TextWrappingMode.FOREIGN_OBJECT in Python API (uses <foreignObject>). Note: not supported by ResvgRasterizer, only works in browsers
  • Blending modes: Some advanced modes approximated due to CSS spec limitations (Dissolve, Linear Burn/Dodge, Darker/Lighter Color, Vivid/Linear/Pin Light, Hard Mix, Subtract, Divide)
  • Gradients: Advanced types not supported (Angle, Reflected, Diamond)
  • Filter effects: Bevels, embossing, and satin effects not supported; other effects are approximations
  • Adjustment layers: Some not yet implemented (Black & White, Channel Mixer, Color Lookup, Gradient Map, Photo Filter, Selective Color, Vibrance)
  • Smart objects: Smart object filters not implemented
  • Thread safety: APIs are not thread-safe

See the full documentation for complete details and workarounds.

Documentation

Full documentation is available at psd2svg.readthedocs.io

Platform Support

All platforms (Linux, macOS, Windows) are fully supported for text conversion and font embedding. Text layer conversion uses a hybrid approach with built-in font mappings (~4,950 fonts) plus platform-specific font resolution.

For detailed font resolution architecture, platform-specific implementation details, and custom font mapping, see the Font Handling documentation and Technical Notes.

Security

psd2svg includes built-in security features for processing untrusted PSD files:

  • Resource limits (file size, timeout, layer depth, dimensions)
  • Path traversal protection
  • Font file validation

For comprehensive security guidance, sandboxing strategies, and production deployment best practices, see the Security Documentation. To report vulnerabilities, see SECURITY.md.

Development

# Install dependencies
uv sync

# Optional: Install browser support for PlaywrightRasterizer
uv sync --extra browser
uv run playwright install chromium

# Run tests
uv run pytest

# Run type checking and linting
uv run mypy src/ tests/
uv run ruff check src/ tests/
uv run ruff format src/ tests/

See CLAUDE.md for detailed development instructions.

License

MIT License - see LICENSE file for details.

Release files for psd2svg 0.12.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for psd2svg 0.12.1
File Interpreter ABI Platform
psd2svg-0.12.1-py3-none-any.whl Python 3 none any Details

Release files / psd2svg-0.12.1-py3-none-any.whl

Download URL psd2svg-0.12.1-py3-none-any.whl
Size 181.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a721d4843e85492ac9d5ed70f6d5bb2d633e0b173864161dfdf91fd577ae360e
BLAKE2b-256 checksum
How to use checksums
13e20181277d46ae517624e2dcdfc8ef682694dfcb052283a3c2edd24587cc70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.12.1 This release

1 release file

0.12.0

1 release file

0.11.0

1 release file

0.10.1

1 release file

0.10.0

1 release file

0.9.0

1 release file

0.8.0

1 release file

0.7.1

1 release file

0.7.0

1 release file

0.6.0

1 release file

0.5.0

1 release file

0.4.0

1 release file

0.3.0

1 release file

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.8

1 release file

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page