twolfson / gulp.spritesmith

Convert a set of images into a spritesheet and CSS variables via gulp
The Unlicense
1.08k stars 81 forks source link

spritesmith reduces a quality #62

Closed yustnip closed 9 years ago

yustnip commented 9 years ago

After spritesmith a quality of images is reduced. For example:

twolfson commented 9 years ago

I see some artifacts in the original image which is a JPG but don't see those artifacts in the spritesheet. What happens when you generate a spritesheet with only that 1 image?

P.S. I am going on vacation tomorrow for 2 weeks so I will likely be unresponsive after that. Other things to try: switching spritesmith engines.

yustnip commented 9 years ago

The sprite with from only 1 image: https://yadi.sk/i/JZg6Wrkqihbyg (a quality was reduced)

I'll try to switch engines.

twolfson commented 9 years ago

What are the options you are passing to gulp.spritesmith?

yustnip commented 9 years ago
gulp.task('spritesmith', function() {
    var spriteData = gulp.src('./images/src/sprite/*.*').pipe(spritesmith({
        imgName: 'sprite.png',
        cssName: 'sprite.styl',
        cssFormat: 'stylus'
    }));
    spriteData.img.pipe(gulp.dest('./images/')); // путь, куда сохраняем картинку
    spriteData.css.pipe(gulp.dest('./styl/helpers/')); // путь, куда сохраняем стили
});
twolfson commented 9 years ago

It looks like the issue is being caused by loading from a JPG as the source image. There are a few options:

yustnip commented 9 years ago

Resaved images to .png. Now it's OK, thanks! Have a good vacations!

twolfson commented 9 years ago

That's great to hear. Thanks I will =)

artem-malko commented 9 years ago

Awesome :+1: