node-sprite-generator icon indicating copy to clipboard operation
node-sprite-generator copied to clipboard

Odd number in options.layoutOptions.padding produces blurred sprite

Open sanbor opened this issue 9 years ago • 6 comments

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.

sanbor avatar Jun 01 '16 19:06 sanbor

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)

selaux avatar Jun 08 '16 17:06 selaux

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.

sanbor avatar Jun 08 '16 20:06 sanbor

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

selaux avatar Jun 09 '16 07:06 selaux

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.

jaime-olivares avatar Jul 06 '16 00:07 jaime-olivares

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

selaux avatar Jul 19 '16 16:07 selaux

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

selaux avatar Mar 02 '17 17:03 selaux