A Grunt task to remove unecessary bytes of PNG and JPG using Yahoo Smushit
Smush.it uses optimization techniques specific to image format to remove unnecessary bytes from image files. It is a "lossless" tool, which means it optimizes the images without changing their look or visual quality.
Install this grunt plugin next to your project's grunt.js gruntfile with:
npm install grunt-smushit
Then add this line to your project's
There are many ways to use grunt-smushit:
smushit:// with output folder (should not be inside source path)destination:src:'tests/img'dest:'tests/opt_img'//with source images and output folderdestination1:src:'tests/img/logo.png''tests/img/whatever.png'dest:'tests/img/min'// recursive extension filter with output folderdestination2:src: 'tests/img/**/*.png'dest:'tests/img/min'//replace imagesspecific:src:'tests/img/logo.png''tests/img/tellme.jpg'//replace by extensionspecificExtension:src:'tests/img/**/*.png'//replace recursivepath:src:'tests/img'//replace single imagesingle:src:'tests/img/logo.png'
MIT License (c) Helder Santana
based on: grunt-recess