piqnt / svgexport

SVG to PNG/JPEG command-line tool and Node.js module
927 stars 85 forks source link

Striped output #39

Closed msageryd closed 7 years ago

msageryd commented 7 years ago

Thank you for your great effort! I'm having some trouble, though.

When I convert this svg to png or jpg it becomes striped. If I open the svg in Affinity Designer it looks as it should.

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg" version="1.1">
  <rect
    x="8.695652173913043"
    y="8.695652173913043"
    width="182.6086956521739"
    height="182.6086956521739"
    fill="white"
  />
  <path
    d="M8.695652173913043 13.043478260869565 L69.56521739130434 13.043478260869565 M95.65217391304348 13.043478260869565 L104.34782608695652 13.043478260869565 M130.43478260869563 13.043478260869565 L191.30434782608694 13.043478260869565 M8.695652173913043 21.73913043478261 L17.391304347826086 21.73913043478261 M60.8695652173913 21.73913043478261 L69.56521739130434 21.73913043478261 M78.26086956521739 21.73913043478261 L86.95652173913044 21.73913043478261 M95.65217391304348 21.73913043478261 L104.34782608695652 21.73913043478261 M113.04347826086956 21.73913043478261 L121.73913043478261 21.73913043478261 M130.43478260869563 21.73913043478261 L139.1304347826087 21.73913043478261 M182.6086956521739 21.73913043478261 L191.30434782608694 21.73913043478261 M8.695652173913043 30.43478260869565 L17.391304347826086 30.43478260869565 M26.08695652173913 30.43478260869565 L52.173913043478265 30.43478260869565 M60.8695652173913 30.43478260869565 L69.56521739130434 30.43478260869565 M104.34782608695652 30.43478260869565 L113.04347826086956 30.43478260869565 M130.43478260869563 30.43478260869565 L139.1304347826087 30.43478260869565 M147.82608695652172 30.43478260869565 L173.91304347826085 30.43478260869565 M182.6086956521739 30.43478260869565 L191.30434782608694 30.43478260869565 M8.695652173913043 39.130434782608695 L17.391304347826086 39.130434782608695 M26.08695652173913 39.130434782608695 L52.173913043478265 39.130434782608695 M60.8695652173913 39.130434782608695 L69.56521739130434 39.130434782608695 M86.95652173913044 39.130434782608695 L104.34782608695652 39.130434782608695 M130.43478260869563 39.130434782608695 L139.1304347826087 39.130434782608695 M147.82608695652172 39.130434782608695 L173.91304347826085 39.130434782608695 M182.6086956521739 39.130434782608695 L191.30434782608694 39.130434782608695 M8.695652173913043 47.826086956521735 L17.391304347826086 47.826086956521735 M26.08695652173913 47.826086956521735 L52.173913043478265 47.826086956521735 M60.8695652173913 47.826086956521735 L69.56521739130434 47.826086956521735 M78.26086956521739 47.826086956521735 L95.65217391304348 47.826086956521735 M104.34782608695652 47.826086956521735 L121.73913043478261 47.826086956521735 M130.43478260869563 47.826086956521735 L139.1304347826087 47.826086956521735 M147.82608695652172 47.826086956521735 L173.91304347826085 47.826086956521735 M182.6086956521739 47.826086956521735 L191.30434782608694 47.826086956521735 M8.695652173913043 56.52173913043478 L17.391304347826086 56.52173913043478 M60.8695652173913 56.52173913043478 L69.56521739130434 56.52173913043478 M86.95652173913044 56.52173913043478 L95.65217391304348 56.52173913043478 M104.34782608695652 56.52173913043478 L113.04347826086956 56.52173913043478 M130.43478260869563 56.52173913043478 L139.1304347826087 56.52173913043478 M182.6086956521739 56.52173913043478 L191.30434782608694 56.52173913043478 M8.695652173913043 65.21739130434783 L69.56521739130434 65.21739130434783 M78.26086956521739 65.21739130434783 L86.95652173913044 65.21739130434783 M95.65217391304348 65.21739130434783 L104.34782608695652 65.21739130434783 M113.04347826086956 65.21739130434783 L121.73913043478261 65.21739130434783 M130.43478260869563 65.21739130434783 L191.30434782608694 65.21739130434783 M86.95652173913044 73.91304347826086 L104.34782608695652 73.91304347826086 M8.695652173913043 82.6086956521739 L17.391304347826086 82.6086956521739 M26.08695652173913 82.6086956521739 L34.78260869565217 82.6086956521739 M43.47826086956522 82.6086956521739 L52.173913043478265 82.6086956521739 M60.8695652173913 82.6086956521739 L69.56521739130434 82.6086956521739 M95.65217391304348 82.6086956521739 L104.34782608695652 82.6086956521739 M113.04347826086956 82.6086956521739 L121.73913043478261 82.6086956521739 M147.82608695652172 82.6086956521739 L156.52173913043475 82.6086956521739 M173.91304347826085 82.6086956521739 L182.6086956521739 82.6086956521739 M26.08695652173913 91.30434782608695 L60.8695652173913 91.30434782608695 M69.56521739130434 91.30434782608695 L78.26086956521739 91.30434782608695 M95.65217391304348 91.30434782608695 L113.04347826086956 91.30434782608695 M121.73913043478261 91.30434782608695 L130.43478260869563 91.30434782608695 M139.1304347826087 91.30434782608695 L147.82608695652172 91.30434782608695 M173.91304347826085 91.30434782608695 L191.30434782608694 91.30434782608695 M8.695652173913043 100 L17.391304347826086 100 M26.08695652173913 100 L34.78260869565217 100 M60.8695652173913 100 L113.04347826086956 100 M121.73913043478261 100 L147.82608695652172 100 M156.52173913043475 100 L191.30434782608694 100 M34.78260869565217 108.69565217391303 L60.8695652173913 108.69565217391303 M78.26086956521739 108.69565217391303 L130.43478260869563 108.69565217391303 M139.1304347826087 108.69565217391303 L156.52173913043475 108.69565217391303 M173.91304347826085 108.69565217391303 L182.6086956521739 108.69565217391303 M8.695652173913043 117.39130434782608 L17.391304347826086 117.39130434782608 M26.08695652173913 117.39130434782608 L34.78260869565217 117.39130434782608 M43.47826086956522 117.39130434782608 L52.173913043478265 117.39130434782608 M60.8695652173913 117.39130434782608 L69.56521739130434 117.39130434782608 M86.95652173913044 117.39130434782608 L113.04347826086956 117.39130434782608 M121.73913043478261 117.39130434782608 L147.82608695652172 117.39130434782608 M156.52173913043475 117.39130434782608 L165.2173913043478 117.39130434782608 M173.91304347826085 117.39130434782608 L191.30434782608694 117.39130434782608 M78.26086956521739 126.08695652173913 L86.95652173913044 126.08695652173913 M130.43478260869563 126.08695652173913 L139.1304347826087 126.08695652173913 M156.52173913043475 126.08695652173913 L165.2173913043478 126.08695652173913 M182.6086956521739 126.08695652173913 L191.30434782608694 126.08695652173913 M8.695652173913043 134.78260869565216 L69.56521739130434 134.78260869565216 M86.95652173913044 134.78260869565216 L95.65217391304348 134.78260869565216 M113.04347826086956 134.78260869565216 L121.73913043478261 134.78260869565216 M147.82608695652172 134.78260869565216 L165.2173913043478 134.78260869565216 M173.91304347826085 134.78260869565216 L191.30434782608694 134.78260869565216 M8.695652173913043 143.47826086956522 L17.391304347826086 143.47826086956522 M60.8695652173913 143.47826086956522 L69.56521739130434 143.47826086956522 M95.65217391304348 143.47826086956522 L104.34782608695652 143.47826086956522 M130.43478260869563 143.47826086956522 L139.1304347826087 143.47826086956522 M173.91304347826085 143.47826086956522 L182.6086956521739 143.47826086956522 M8.695652173913043 152.17391304347825 L17.391304347826086 152.17391304347825 M26.08695652173913 152.17391304347825 L52.173913043478265 152.17391304347825 M60.8695652173913 152.17391304347825 L69.56521739130434 152.17391304347825 M78.26086956521739 152.17391304347825 L104.34782608695652 152.17391304347825 M113.04347826086956 152.17391304347825 L121.73913043478261 152.17391304347825 M130.43478260869563 152.17391304347825 L139.1304347826087 152.17391304347825 M147.82608695652172 152.17391304347825 L165.2173913043478 152.17391304347825 M173.91304347826085 152.17391304347825 L191.30434782608694 152.17391304347825 M8.695652173913043 160.86956521739128 L17.391304347826086 160.86956521739128 M26.08695652173913 160.86956521739128 L52.173913043478265 160.86956521739128 M60.8695652173913 160.86956521739128 L69.56521739130434 160.86956521739128 M95.65217391304348 160.86956521739128 L113.04347826086956 160.86956521739128 M121.73913043478261 160.86956521739128 L130.43478260869563 160.86956521739128 M139.1304347826087 160.86956521739128 L147.82608695652172 160.86956521739128 M173.91304347826085 160.86956521739128 L182.6086956521739 160.86956521739128 M8.695652173913043 169.56521739130434 L17.391304347826086 169.56521739130434 M26.08695652173913 169.56521739130434 L52.173913043478265 169.56521739130434 M60.8695652173913 169.56521739130434 L69.56521739130434 169.56521739130434 M78.26086956521739 169.56521739130434 L113.04347826086956 169.56521739130434 M121.73913043478261 169.56521739130434 L147.82608695652172 169.56521739130434 M165.2173913043478 169.56521739130434 L173.91304347826085 169.56521739130434 M182.6086956521739 169.56521739130434 L191.30434782608694 169.56521739130434 M8.695652173913043 178.26086956521738 L17.391304347826086 178.26086956521738 M60.8695652173913 178.26086956521738 L69.56521739130434 178.26086956521738 M95.65217391304348 178.26086956521738 L130.43478260869563 178.26086956521738 M139.1304347826087 178.26086956521738 L165.2173913043478 178.26086956521738 M173.91304347826085 178.26086956521738 L182.6086956521739 178.26086956521738 M8.695652173913043 186.95652173913044 L69.56521739130434 186.95652173913044 M78.26086956521739 186.95652173913044 L113.04347826086956 186.95652173913044 M121.73913043478261 186.95652173913044 L147.82608695652172 186.95652173913044 M165.2173913043478 186.95652173913044 L191.30434782608694 186.95652173913044 "
    stroke="blue"
    stroke-width="8.695652173913043"
  />
</svg>

test

msageryd commented 7 years ago

Solved it with ImageMagick instead.

shakiba commented 7 years ago

@michaelswe This issue is in how PhantomJS renders SVG, and it is not limited to PhantomJS, I have seen the same glitch in other SVG editors and viewers as well. Anyway, I'm glad that you found a solution!