Skip to main content

Convert PSD file to SVG file

Project description

PSD to SVG converter based on psd-tools2 and svgwrite.

PyPI Version Build Status

Install

Use pip to install:

pip install psd2svg

To use AWS S3 storage backend:

pip install boto3

Usage

The package comes with a command-line tool:

psd2svg input.psd output.svg

When the output path is a directory, or omitted, the tool infers the output name from the input:

psd2svg input.psd output/  # => output/input.svg
psd2svg input.psd          # => input.svg

When --export-resource flag is specified, all png resources are exported to the path specified by --resource-prefix:

psd2svg input.psd output.svg --export-resource
# => output.svg, xxx1.png, ...

psd2svg input.psd output/ --export-resource
# => output/input.svg, output/xxx1.png, ...

psd2svg input.psd output/ --export-resource --resource-prefix=resources/
# => output/input.svg, output/resources/xxx1.png, ...

psd2svg input.psd svg/ --export-resource --resource-prefix=../png/
# => svg/input.svg, png/xxx1.png, ...

To render text in vector stroke:

psd2svg input.psd output/ --text-mode text

The tool can specify URL instead of file path (S3 requires boto3):

psd2svg http://example.com/input.psd
psd2svg s3://bucketname/path/to/input.psd s3://bucketname/path/to/output/

API

The package contains high-level conversion method run_convert:

from psd2svg import PSD2SVG

PSD2SVG.run_convert('path/to/input.psd', 'path/to/output/')

Test

Invoke tox:

tox

Notes

  • SVG 1.1 does not cover all the blending modes in Photoshop (e.g., linear-dodge)

  • Filter effects are approximation. Some effects are not implemented.

  • Most of adjustments layers are not implemented.

  • Smart object filters are not implemented.

  • Browser support: SVG rendering quality greatly differs depending on the browser. Chrome tends to be the best quality.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

psd2svg-0.1.0a2-py2.py3-none-any.whl (18.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file psd2svg-0.1.0a2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for psd2svg-0.1.0a2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 bc986b59763284549cc52359c04a58a1c0b0e46fde344f1570f45f833b7e9d8f
MD5 4657a9b9164156c9229a38771a578103
BLAKE2b-256 907f61dd7ff12844558d2d1ef112bc7cbadf9c83dec1ee87ab75b3c779e30559

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page