selaux / node-sprite-generator

Generates image sprites and their spritesheets (css, stylus, sass or less) from sets of images. Supports retina sprites. Provides express middleware and grunt task.
MIT License
191 stars 39 forks source link

Odd number in options.layoutOptions.padding produces blurred sprite #48

Open sanbor opened 8 years ago

sanbor commented 8 years ago

Try generating an sprite with options.layoutOptions.padding = 5 and you'll notice that the generated sprite is blurred. Probably it's due to some rounding when positioning the elements.

Please at least add a warning in the docs until it's fixed.

selaux commented 8 years ago

This might be a compositor issue, since we only use integers to do the layout as far as I know. Can you ellaborate some more on your configuration? (I currently dont have a lot of time to test)

sanbor commented 8 years ago

I'm trying to reproduce the bug with some random images but the results seems to be right. I wonder if I need some particular image sizes to be able to reproduce the issue. I'll keep trying and let you know.

selaux commented 8 years ago

Does it maybe only happen for the packed layout? I see some integer divisions there.

jaime-olivares commented 8 years ago

In general the jimp compositor seems to produce blurry results. I have tried scaling and the quality of the icons is really poor. That's a bummer, as I liked the pure-javascript option. By the way, all those messages related to the canvas installation are really annoying.

selaux commented 8 years ago

So an even padding also produces blurry results? If so please file an issue with https://github.com/oliver-moran/jimp.

selaux commented 7 years ago

Can you still reproduce this on current master? Is this maybe related to scaling?