mapbox / spritezero

small opinionated sprites
Other
173 stars 62 forks source link

spritezero-cli is producing blurry images for some svgs, maybe anti-aliased #50

Closed JesseCrocker closed 4 years ago

JesseCrocker commented 7 years ago

spritezero-cli version 2.0.0 spritezero version 4.0.1

Source svg: https://gist.github.com/JesseCrocker/c813239c149b7849d5efd733cf88eb3f

Comparison between output from spritezero and convert(Imagemagick)

screen shot 2017-06-08 at 12 52 08 pm

spritezero output: spritezero

imagemagick output: imagemagick

springmeyer commented 7 years ago

For reference, this is the svg rendered with Mapnik v3.0.x's svg2pngutility:

source

To my eye it looks somewhere between the spritezero output and the imagemagick output. Spritezero under the hood rasterizes with mapnik and then lays out with node-mapnik.blend. It may be that the blend step is introducing slightly more blurring. I'm not sure if this is avoidable.

springmeyer commented 4 years ago

It may be that the blend step is introducing slightly more blurring. I'm not sure if this is avoidable.

I don't think this is easily avoidable. Not without snapping the svg location to an integer grid, which is not something I see myself or others having time to invest in. If someone is interested in diving deeper into this issue, please comment, but for now I'll close.