kyamagu / psd2svg Goto Github PK
View Code? Open in Web Editor NEWPSD to SVG converter.
License: MIT License
PSD to SVG converter.
License: MIT License
Basic text conversion is implemented, but the quality can be further improved.
I think the following shape
layer handling is not executed, because the previous elif
clause is executed. (The reason is the majority of shapes has (width, height) > (0, 0))
psd2svg/src/psd2svg/converter/core.py
Line 148 in 75c1276
I think if the handling is enhanced, PSD->SVG translation will become better.
(But only reordering the clauses didn't work...!)
Hi there,
first of all. thanks for the super helpfull package. I got it to work ... like ones. After that i dont get the result im aiming for.
I only get svg filled with pngs.
Also if my psd only consists of on shape layer.
Using PSD CC 2019
psd2svg a.psd b.svg
Traceback (most recent call last):
File "/home/msieprawski/.local/bin/psd2svg", line 11, in <module>
sys.exit(main())
File "/home/msieprawski/.local/lib/python2.7/site-packages/psd2svg/__main__.py", line 39, in main
converter.convert(args.output)
File "/home/msieprawski/.local/lib/python2.7/site-packages/psd2svg/convert.py", line 158, in convert
self._add_group(self._psd.layers)
File "/home/msieprawski/.local/lib/python2.7/site-packages/psd2svg/convert.py", line 222, in _add_group
self._add_layer(layer)
File "/home/msieprawski/.local/lib/python2.7/site-packages/psd2svg/convert.py", line 230, in _add_layer
mask = self._add_mask_if_exist(layer)
File "/home/msieprawski/.local/lib/python2.7/site-packages/psd2svg/convert.py", line 367, in _add_mask_if_exist
mask_data = layer.mask_data
AttributeError: 'PixelLayer' object has no attribute 'mask_data
PSD2SVG
class gets too big. Must be refactored. There are different options; c.f., http://www.qtrac.eu/pyclassmulti.html Perhaps there should be submodules to split text, shape, effects, and adjustment conversion.
from psd2svg import psd2svg
from psd_tools import PSDImage
psd_file = "/home/zhoupc/template-photoshop/data/fo/test.psd"
psd = PSDImage.open(psd_file)
print(psd2svg(psd[1]))
then i get:
<title>矩形 1</title>This layer is: "ShapeLayer('矩形 1' size=301x268)"
The shape is belike this:
I can't upload the psd file to github, if you need it, i can send it by other way. Thanks for your wonderful work!!!
Currently adjustments are not converted. Implement all of the conversions.
Hi,
I run accross this error converting a psd to svg.
I suppose this psd file contains raster images that are converted to png. I'd like to have an option to disable raster convertion; as in this precise case I only need some vector parts.
Traceback (most recent call last):
File "/home/bruno/.local/bin/psd2svg", line 10, in <module>
sys.exit(main())
File "/home/bruno/.local/lib/python2.7/site-packages/psd2svg/__main__.py", line 39, in main
psd2svg(args.input, args.output, resource_path=args.resource_path)
File "/home/bruno/.local/lib/python2.7/site-packages/psd2svg/__init__.py", line 20, in psd2svg
return converter.convert(input, output)
File "/home/bruno/.local/lib/python2.7/site-packages/psd2svg/__init__.py", line 59, in convert
self.create_group(layer, self._dwg)
File "/home/bruno/.local/lib/python2.7/site-packages/psd2svg/converter/core.py", line 71, in create_group
element = self.convert_layer(layer)
File "/home/bruno/.local/lib/python2.7/site-packages/psd2svg/converter/core.py", line 31, in convert_layer
element = self.create_image(layer)
File "/home/bruno/.local/lib/python2.7/site-packages/psd2svg/converter/core.py", line 85, in create_image
self._get_image_href(layer.topil()),
File "/home/bruno/.local/lib/python2.7/site-packages/psd2svg/converter/io.py", line 106, in _get_image_href
image.save(output, format=fmt, icc_profile=icc_profile)
File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 2088, in save
save_handler(self, fp, filename)
File "/usr/lib/python2.7/dist-packages/PIL/PngImagePlugin.py", line 801, in _save
raise IOError("cannot write mode %s as PNG" % mode)
IOError: cannot write mode CMYK as PNG
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.