incorrect rendering of inkscape authored svg #1312

Closed
springmeyer opened this Issue Jul 11, 2012 · 7 comments

Comments

Projects
None yet
2 participants
@springmeyer

This comment has been minimized.

Show comment
Hide comment
@springmeyer

springmeyer Jul 11, 2012

Member

mapnik on left, safari on right:

Member

springmeyer commented Jul 11, 2012

mapnik on left, safari on right:

@springmeyer

This comment has been minimized.

Show comment
Hide comment
@springmeyer

springmeyer Jul 11, 2012

Member

started stripping down:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" version="1.1">
  <g
     transform="translate(66.28571,-677.50503)">
    <g
       transform="translate(-150.28571,-488.85715)">
      <g
         transform="translate(83,162)"
         style="opacity:0.3;color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
         />
      <g
         style="display:inline"
         transform="translate(83,162)">
        <path
           d="m 9,1007.3622 c -0.5540096,0 -1,0.446 -1,1 l 0,16 c 0,0.5 0.5,1 1,1 l 9,0 c 0.5,0 1,-0.5 1,-1 l 0,-5 0.5,0 c 0.5,0 0.5,0.5 0.5,0.5 l 0,2 c 0,1 0.5,1.5 1.5,1.5 1,0 1.5,-0.5 1.5,-1.5 0,-1.1667 0,-4.5 0,-5.5 0,-1 -2,-2 -2,-3 l 0,-3 -1,0 -1,-1 0,-1 c 0,-0.554 -0.44599,-1 -1,-1 z m 1,2 7,0 0,4 -7,0 z m 9,3 1,0 c 0,0 0,0.8333 0,1.5 0,1 2,2 2,3 l 0,5 c 0,0.5 -0.5,0.5 -0.5,0.5 0,0 -0.5,0 -0.5,-0.5 0,0 0,-2 0,-2.5 0,-0.5 -0.5,-1 -1,-1 -0.333333,0 -1,0 -1,0 z"
           style="opacity:0.3;color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
           />
        <path
           style="color:#000000;fill:#444444;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
           d="m 9,1007.3622 c -0.5540096,0 -1,0.446 -1,1 l 0,16 c 0,0.5 0.5,1 1,1 l 9,0 c 0.5,0 1,-0.5 1,-1 l 0,-5 0.5,0 c 0.5,0 0.5,0.5 0.5,0.5 l 0,2 c 0,1 0.5,1.5 1.5,1.5 1,0 1.5,-0.5 1.5,-1.5 0,-1.1667 0,-4.5 0,-5.5 0,-1 -2,-2 -2,-3 l 0,-3 -1,0 -1,-1 0,-1 c 0,-0.554 -0.44599,-1 -1,-1 z m 1,2 7,0 0,4 -7,0 z m 9,3 1,0 c 0,0 0,0.8333 0,1.5 0,1 2,2 2,3 l 0,5 c 0,0.5 -0.5,0.5 -0.5,0.5 0,0 -0.5,0 -0.5,-0.5 0,0 0,-2 0,-2.5 0,-0.5 -0.5,-1 -1,-1 -0.333333,0 -1,0 -1,0 z"
           />
      </g>
    </g>
  </g>
</svg>
Member

springmeyer commented Jul 11, 2012

started stripping down:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" version="1.1">
  <g
     transform="translate(66.28571,-677.50503)">
    <g
       transform="translate(-150.28571,-488.85715)">
      <g
         transform="translate(83,162)"
         style="opacity:0.3;color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
         />
      <g
         style="display:inline"
         transform="translate(83,162)">
        <path
           d="m 9,1007.3622 c -0.5540096,0 -1,0.446 -1,1 l 0,16 c 0,0.5 0.5,1 1,1 l 9,0 c 0.5,0 1,-0.5 1,-1 l 0,-5 0.5,0 c 0.5,0 0.5,0.5 0.5,0.5 l 0,2 c 0,1 0.5,1.5 1.5,1.5 1,0 1.5,-0.5 1.5,-1.5 0,-1.1667 0,-4.5 0,-5.5 0,-1 -2,-2 -2,-3 l 0,-3 -1,0 -1,-1 0,-1 c 0,-0.554 -0.44599,-1 -1,-1 z m 1,2 7,0 0,4 -7,0 z m 9,3 1,0 c 0,0 0,0.8333 0,1.5 0,1 2,2 2,3 l 0,5 c 0,0.5 -0.5,0.5 -0.5,0.5 0,0 -0.5,0 -0.5,-0.5 0,0 0,-2 0,-2.5 0,-0.5 -0.5,-1 -1,-1 -0.333333,0 -1,0 -1,0 z"
           style="opacity:0.3;color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
           />
        <path
           style="color:#000000;fill:#444444;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
           d="m 9,1007.3622 c -0.5540096,0 -1,0.446 -1,1 l 0,16 c 0,0.5 0.5,1 1,1 l 9,0 c 0.5,0 1,-0.5 1,-1 l 0,-5 0.5,0 c 0.5,0 0.5,0.5 0.5,0.5 l 0,2 c 0,1 0.5,1.5 1.5,1.5 1,0 1.5,-0.5 1.5,-1.5 0,-1.1667 0,-4.5 0,-5.5 0,-1 -2,-2 -2,-3 l 0,-3 -1,0 -1,-1 0,-1 c 0,-0.554 -0.44599,-1 -1,-1 z m 1,2 7,0 0,4 -7,0 z m 9,3 1,0 c 0,0 0,0.8333 0,1.5 0,1 2,2 2,3 l 0,5 c 0,0.5 -0.5,0.5 -0.5,0.5 0,0 -0.5,0 -0.5,-0.5 0,0 0,-2 0,-2.5 0,-0.5 -0.5,-1 -1,-1 -0.333333,0 -1,0 -1,0 z"
           />
      </g>
    </g>
  </g>
</svg>

@ghost ghost assigned artemp Jul 11, 2012

@artemp

This comment has been minimized.

Show comment
Hide comment
@artemp

artemp Jul 12, 2012

Member

@springmeyer - 461f5cf should fix this (needs testing)

Member

artemp commented Jul 12, 2012

@springmeyer - 461f5cf should fix this (needs testing)

@springmeyer

This comment has been minimized.

Show comment
Hide comment
@springmeyer

springmeyer Jul 12, 2012

Member

Yep, SVG is now properly colored. The blurryess still persists, but lets discuss and track at #1316

Member

springmeyer commented Jul 12, 2012

Yep, SVG is now properly colored. The blurryess still persists, but lets discuss and track at #1316

@springmeyer

This comment has been minimized.

Show comment
Hide comment
@springmeyer

springmeyer Oct 3, 2012

Member

I said above that the "blurryness" persists. Looking deeper (after fixing the perhaps related #1508), I see there are at least two causes for blurryness. One is that the svg2png utility I was using to test was not handling premultiplication of pixels properly. This leads to gray fringing like:

The other issue I see (when actually rendering in a map) is blurryness of the svg icons the farther from the center of the map you go:

Member

springmeyer commented Oct 3, 2012

I said above that the "blurryness" persists. Looking deeper (after fixing the perhaps related #1508), I see there are at least two causes for blurryness. One is that the svg2png utility I was using to test was not handling premultiplication of pixels properly. This leads to gray fringing like:

The other issue I see (when actually rendering in a map) is blurryness of the svg icons the farther from the center of the map you go:

@springmeyer springmeyer reopened this Oct 3, 2012

springmeyer pushed a commit that referenced this issue Oct 3, 2012

@springmeyer

This comment has been minimized.

Show comment
Hide comment
@springmeyer

springmeyer Oct 3, 2012

Member

ha, nevermind on that last image - the center one looks sharp to me while the others look blurry but I think its actually an illusion based on the resampling effects of chrome at a specific size....

edit: no, looking closer, the images at the sides ARE more blurry.

Member

springmeyer commented Oct 3, 2012

ha, nevermind on that last image - the center one looks sharp to me while the others look blurry but I think its actually an illusion based on the resampling effects of chrome at a specific size....

edit: no, looking closer, the images at the sides ARE more blurry.

@springmeyer

This comment has been minimized.

Show comment
Hide comment
@springmeyer

springmeyer Mar 9, 2013

Member

closing as per #1316 - the distance from the center was a red herring. The actual issue was the need for snapping to pixel coordinates before rendering, needed by both rasters (expecially) and also small but complexly shaped svg icons like this.

Member

springmeyer commented Mar 9, 2013

closing as per #1316 - the distance from the center was a red herring. The actual issue was the need for snapping to pixel coordinates before rendering, needed by both rasters (expecially) and also small but complexly shaped svg icons like this.

@springmeyer springmeyer closed this Mar 9, 2013

PetrDlouhy added a commit to PetrDlouhy/mapnik that referenced this issue Aug 22, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment