"clean:coverage": "node_modules/rimraf/bin. "clean:build": "node_modules/rimraf/bin.js build", "build:safari": "node_modules/.bin/cross-env NODE_ENV=production _BROWSER_=safari node_modules/.bin/npm-run-all webpack", "build:edge": "node_modules/.bin/cross-env NODE_ENV=production _BROWSER_=edge node_modules/.bin/npm-run-all webpack", "build:opera": "node_modules/.bin/cross-env NODE_ENV=production _BROWSER_=opera node_modules/.bin/npm-run-all webpack", You can also use transparency to make them even smaller. From their site: Optimize your animations This stores only the changed portion of each frame, and can radically shrink your GIFs. As far as I know, it works quite well (I dont generally use Gif these days). "build:firefox": "node_modules/.bin/cross-env NODE_ENV=production _BROWSER_=firefox node_modules/.bin/npm-run-all webpack", ImageOptim uses Gifsicle for its Gif compression. "build:chrome": "node_modules/.bin/cross-env NODE_ENV=production _BROWSER_=chrome node_modules/.bin/npm-run-all webpack", "build:all": "node_modules/.bin/cross-env NODE_ENV=production _BROWSER_=all node_modules/.bin/npm-run-all webpack", "build": "node_modules/.bin/npm-run-all build:chrome", "webpack:dll:gen": "./node_modules/.bin/webpack -config config/webpack/", "start:dev": "node scripts/hot-reload.js", "start:hot-reload": "node_modules/.bin/cross-env NODE_ENV=development node_modules/.bin/npm-run-all webpack:dll:gen start:dev", "start:old": "node_modules/.bin/cross-env NODE_ENV=development node scripts/dev-middleware.js", : `$') node scripts/dev-middleware.js\"", If you did do that the speed may change, fixed with gifspeedchange input-opt.gif 5 for example, to use a 50ms frame delay.Const argv = require('minimist')((2)) Ĭonst CleanPlugin = require('clean-webpack-plugin') Ĭonst CopyPlugin = require('copy-webpack-plugin') Ĭonst HtmlPlugin = require('html-webpack-plugin') Ĭonst ExtractTextPlugin = require('extract-text-webpack-plugin') Ĭonst StyleLintPlugin = require('stylelint-webpack-plugin') Ĭonst ExtendedDefinePlugin = require('extended-define-webpack-plugin') Ĭonst WriteFilePlugin = require('write-file-webpack-plugin') Ĭonst AddAssetHtmlPlugin = require('add-asset-html-webpack-plugin') Ĭonst PORT = argv || defaults.HMR_PORT || 3000 you could have an intermediate file input_reduced_x2.gif (a step that would ~halve file size by dropping every other frame). That function also works to remove any _reduced_x suffix added by the frame count reduction function, i.e. You could change the function to use the -batch flag for in-place editing but I wouldn't recommend overwriting your starting material. the output would be automatically named input-opt.gif. With the above function gifopt you could simplify matters, since it defaults to 30 gifopt input.gif The -lossy flag takes an integer from 30 to 200, so for best quality: gifsicle -O3 -lossy=30 -o output.gif input.gif Local newframerate=$(echo "$frame_delay*10" | bc)Įcho "new GIF frame rate: $newframerate ms" Gifsicle -batch -delay $frame_delay $orig_gif I won't describe how I do it all here, the general idea is a few bash functions/aliases: function gifopt() My notes on a full gif optimisation workflow are here.Įdit: current script as kept in use will be updated on GitHub here See release 1.82.1 here (replace /usr/bin/gifsicle with the appropriate one for your system (the binary ending with -static). The difference is that ezgif uses a gifsicle modification (with a lossy flag), not available on the apt version. I use /optimize, as GIMP and other tools aren't good at this job.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |