Giter Site home page Giter Site logo

psd2svg's People

Contributors

ichiro-arai avatar kyamagu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

psd2svg's Issues

Text enhancements

Basic text conversion is implemented, but the quality can be further improved.

  • Missing font fallback
  • Alignment improvement
  • Vertical text spacing
  • Vertical text glyph-orientation for symbols

Clipping masks do not work

A very simple clipping mask does not create the correct results. The masked layer (base) is included 2 times in the svg file.

Screenshot 2024-04-15 at 14 15 28
Screenshot 2024-04-15 at 14 17 06

pngs in svg

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

Attribute error when converting psd file

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

shapeLayer2svg but I get a base64 format img, how can i get path format?

code:

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 svg's info is a base64 img, How can i get the path of the shape layer?

This layer is: "ShapeLayer('矩形 1' size=301x268)"
The shape is belike this:
test
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!!!

"IOError: cannot write mode CMYK as PNG" when trying to convert a psd to svg

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.