mixtur / webpack-spritesmith

Webpack plugin that converts set of images into a spritesheet and SASS/LESS/Stylus mixins
499 stars 56 forks source link

How to optimise the sprite image? #82

Closed majaray closed 5 years ago

majaray commented 5 years ago

Hi, I have many of png image files that want to convert into a single sprite image. But I found the total size of the png files are less than the sprite image. Sometimes it could be a huge different. May I know is there any approach to optimise the exported sprite image?

Thank you!

mixtur commented 5 years ago

If you use file-loader as in README then you can also use whole universe of webpack plugins that will allow you to compress final image better. Though it is possible that you still will not be able to achieve smaller size. If for example you have small pallettes in every source png, but overall pallette is large then it will be harder to compress combined image better than original.

majaray commented 5 years ago

i see, understood. thanks for your advise @mixtur!