Skip to content

incorrect rendering of inkscape authored svg #1312

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

2 participants

@springmeyer
Mapnik member

mapnik on left, safari on right:

@springmeyer
Mapnik 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>
@artemp artemp was assigned Jul 11, 2012
@artemp
Mapnik member
artemp commented Jul 12, 2012

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

@springmeyer
Mapnik member

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

@springmeyer
Mapnik 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:

@springmeyer springmeyer reopened this Oct 3, 2012
@springmeyer springmeyer added a commit that referenced this issue Oct 3, 2012
@springmeyer springmeyer handle demultiplying the png before saving - solves gray halo reporte…
…d in #1312 (when testing with svg2png utility)
5da14ef
@springmeyer
Mapnik 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.

@springmeyer
Mapnik 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.

@springmeyer springmeyer closed this Mar 9, 2013
@PetrDlouhy PetrDlouhy added a commit to PetrDlouhy/mapnik that referenced this issue Aug 22, 2013
@springmeyer springmeyer handle demultiplying the png before saving - solves gray halo reporte…
…d in #1312 (when testing with svg2png utility)
48bb07c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.