
'-O3', // this produces the slowest but best results '-b', // required parameter for this package '-disable=cleanupIDs', // disabling because it is know to cause troubles '-quiet', // required parameter for this package '-o2', // this set the optimization level to two (multiple IDAT compression trials) '-i0', // this will result in a non-interlaced, progressive scanned image '-force', // required parameter for this package '-all-progressive', // this will make sure the resulting image is a progressive one '-strip-all', // this strips out all text information such as comments and EXIF data * When calling `optimize` the package will automatically determine which optimizers Use Spatie\ImageOptimizer\Optimizers\Jpegoptim Use Spatie\ImageOptimizer\Optimizers\Pngquant Use Spatie\ImageOptimizer\Optimizers\Gifsicle Use Spatie\ImageOptimizer\Optimizers\Optipng Use Spatie\ImageOptimizer\Optimizers\Svgo if your want to change any configure value then change according your requirement. Php artisan vendor:publish -provider="Spatie\LaravelImageOptimizer\ImageOptimizerServiceProvider"Īfter run this command and open your config/image-optimizer.php file it look like this. Then after public confige run following command 'ImageOptimizer' => Spatie\LaravelImageOptimizer\ImageOptimizerFacade::class, Spatie\LaravelImageOptimizer\ImageOptimizerServiceProvider::class,

so, open our config/app.php file and set service provider and aliases in it. Step : 1 Install packageįirst we need to install spatie laravel package in our laravel application run following command.Ĭomposer require spatie/laravel-image-optimizerĪfter installtion done then configure package.
#Gifsicle opitmiztion how to#
how to use in laravel application step by step. Here we are show how to image optimization in laravel using spatie laravel package. it image optimization functionality also help us in project size reduce. because image optimization is very needed when we are working on big project and lots of images use in it. Today, Laravelcode share with you one of the helpfull tutorials aboute how to image optimization in laravel using spatie laravel package.
