![npm gifsicle npm gifsicle](https://img-blog.csdnimg.cn/20201124115338332.png)
Normally, Gifsicle’s resize algorithms use input images’ color palettes without changes. resizeColorsĪllow Gifsicle to add intermediate colors when resizing images. Other methods include sample, box, mix, catrom, mitchell, lanczos2, lanczos3. The mix method is somewhat slower, but produces better-looking results. The sample method runs very quickly, but when shrinking images, it produces noisy results. If width or height is an underscore _, that dimension is chosen so that the aspect ratio remains unchanged. Resize the output GIF to the given width and height. The halftone modes take a cell size and a color limit: halftone,10,3 creates 10-pixel wide halftone cells where each cell uses up to 3 colors. gifsicle wrapper that makes it seamlessly available as a local dependency imagemin gif img image compress minify optimize gifsicle 7.0. Some modes take optional parameters using commas. For special effects, try the halftone modes halftone, squarehalftone, and diagonal. The ordered mode chooses a good ordered dithering algorithm. The o3, o4, and o8 modes use smaller, more regular patterns. The ro64 mode uses a large, random-looking pattern and generally produces good results. Gifsicle also supports ordered dithering algorithms that avoid animation artifacts. This usually looks best, but can cause animation artifacts, because dithering choices will vary from frame to frame. The default, floyd-steinberg, uses Floyd-Steinberg error diffusion. Specify a dithering algorithm with the optional method argument. median-cut is the median cut algorithm described by Heckbert. blend-diversity is a modification of this: some color values are blended from groups of existing colors. diversity, the default, is xv(1)’s diversity algorithm, which uses a strict subset of the existing colors and generally produces good results. colorMethodĭetermine how a smaller colormap is chosen. Lossiness determines how many artifacts are allowed higher values can result in smaller file sizes, but cause more artifacts. lossyĪlter image colors to shrink output file size at the cost of artifacts and noise. Reduce the number of distinct colors in each output GIF to num or less. Try several optimization methods (usually slower, sometimes better results).Also uses transparency to shrink the file further.Stores only the changed portion of each image.The optimization level determines how much optimization is done higher levels take longer, but may have better results. Select an optimization level between 1 and 3. Returns a Promise with the optimized image. })() API imageminGifsicle(options?)(buffer)
#NPM GIFSICLE INSTALL#
Install $ npm install Usage const imagemin = require('imagemin') Once the aforementioned PRs are merged I will no longer be maintaining this fork, and may delete it entirely, so if you come across this I do not recommend adding it as a dependency.
#NPM GIFSICLE CODE#
This fork is the same as the base, but included the code from two open PRs to the main repo which have been unmerged for quite some time: Don't throw on inputs larger than 10 MB and Include additional options from the gifsicle command line. Execute sequentially | Execute simultaneouslyĭeveloped on the basis of gifsicle.Fork of the Imagemin plugin for Gifsicle which removes max buffer size and includes more Gifsicle commands.
![npm gifsicle npm gifsicle](https://res.cloudinary.com/hl8zoliad/raw/upload/npm/gulp-minify-html.png)
File, Blob, ArrayBuffer: local files obtained via.import gifsicle from '' // or import gifsicle from ''. Import in vue $ npm i gifsicle-wasm-browser -save
![npm gifsicle npm gifsicle](https://img-blog.csdnimg.cn/20201124114456769.png)
GifsicleTool.js By combining multiple commands, it can complete more practical functions. CompressionĪccording to the upper left and lower right cornersĪccording to the upper left corner and height and width Supports input and output of multiple GIFsįor more commands, please refer to the Gifsicle Manual.Fully restore the functionality of Gifsicle 1.92.Run Gifsicle in your browser to compress, crop, frame, resize, and more on GIFs.