All Projects → kyamagu → psd2svg

kyamagu / psd2svg

Licence: MIT license
PSD to SVG converter.

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to psd2svg

Psd Tools
Python package for reading Adobe Photoshop PSD files
Stars: ✭ 646 (+1515%)
Mutual labels:  photoshop, psd
psd
Blazing fast, zero-dependency PSD parser for the web and Node.js
Stars: ✭ 549 (+1272.5%)
Mutual labels:  photoshop, psd
Psd.rb
Parse Photoshop files in Ruby with ease
Stars: ✭ 3,092 (+7630%)
Mutual labels:  photoshop, psd
Libqpsd
PSD (Photoshop Document) & PSB (Photoshop Big) Plugin for Qt/C++ (Qt4/Qt5)
Stars: ✭ 90 (+125%)
Mutual labels:  photoshop, psd
Ag Psd
Javascript library for reading and writing PSD files
Stars: ✭ 135 (+237.5%)
Mutual labels:  photoshop, psd
Psdinfo
Inspect PSD files from the command line
Stars: ✭ 144 (+260%)
Mutual labels:  photoshop, psd
Psd Templates Requirements
Требования, пожелания и рекомендации к PSD (и не только) макетам
Stars: ✭ 140 (+250%)
Mutual labels:  photoshop, psd
Psd2unityimporter
An advanced PSD importer tool for Unity
Stars: ✭ 155 (+287.5%)
Mutual labels:  photoshop, psd
adobe-discord-rpc
Discord Rich Presence extension for your adobe apps!
Stars: ✭ 383 (+857.5%)
Mutual labels:  photoshop
lut
color lookup tables (LUTs) for color grading
Stars: ✭ 84 (+110%)
Mutual labels:  photoshop
tools-generation-detection-synthetic-content
Compilation of the state of the art of tools, articles, forums and links of interest to generate and detect any type of synthetic content using deep learning.
Stars: ✭ 107 (+167.5%)
Mutual labels:  photoshop
CURL
Code for the ICPR 2020 paper: "CURL: Neural Curve Layers for Image Enhancement"
Stars: ✭ 177 (+342.5%)
Mutual labels:  photoshop
favicon
🖼 An attempt to capture all possible favicons for a web project.
Stars: ✭ 17 (-57.5%)
Mutual labels:  photoshop
oculante
A minimalistic crossplatform image viewer written in rust
Stars: ✭ 169 (+322.5%)
Mutual labels:  psd
unity-ugui-edit-tools
编辑器下的界面工具集合
Stars: ✭ 30 (-25%)
Mutual labels:  psd
PhotoMP
The AppImage version of GIMP for those who come from Photoshop.
Stars: ✭ 68 (+70%)
Mutual labels:  photoshop
pytoshop
Library for reading and writing Photoshop PSD and PSB files
Stars: ✭ 100 (+150%)
Mutual labels:  photoshop
photoshop-react-redux-ramda
🎨😱💀⚛️
Stars: ✭ 24 (-40%)
Mutual labels:  photoshop
faceapp.js
JavaScript API wrapper for the FaceApp tool for Android and iOS
Stars: ✭ 59 (+47.5%)
Mutual labels:  photoshop
photoshop-scripts
Photoshop Scripts for the TinyPNG & TinyJPG Photoshop plugin
Stars: ✭ 43 (+7.5%)
Mutual labels:  photoshop

PSD2SVG

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

PyPI Version Build Status

Install

Use pip to install:

pip install psd2svg

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 --resource-path flag is specified, all png resources are exported to the path specified by --resource-path:

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

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

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

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

API

The package contains high-level conversion function psd2svg:

from psd2svg import psd2svg

# File IO.
psd2svg('path/to/input.psd', 'path/to/output/')

# Stream IO.
with open('input.psd', 'rb') as fi:
    with open('output.svg', 'w') as fo:
        psd2svg(fi, fo)

# psd_tools IO.
from psd_tools import PSDImage
psd = PSDImage.load('path/to/input.psd')
svg = psd2svg(psd)
print(svg)

# Additionally, individual layers can be directly rendered.
layer_svg = psd2svg(psd[3])
print(layer_svg)

The package also has rasterizer module to convert SVG to PIL Image:

from psd2svg.rasterizer import create_rasterizer

rasterizer = create_rasterizer()
image = rasterizer.rasterize(svg)
image.save('path/to/output.png')

The rasterizer requires one of Selenium + ChromeDriver, Apache Batik, or Inkscape. Make sure to install them beforehand.

Test

Invoke tox:

tox

Storage backend support

To use AWS S3 storage backend:

pip install psd2svg[s3]

or:

pip install boto3

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/

To use HDFS storage backend:

pip install psd2svg[hdfs,kerberos]

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.
  • APIs of this tool is NOT thread-safe.
  • To use HDFS storage backend, Python 2.7 environment is needed and should be Kerberos-enabled and only read access is available.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].