Yuriy-Svetlov / compress-images

Minify size your images. Image compression with extension: jpg/jpeg, svg, png, gif. NodeJs
https://www.npmjs.com/package/compress-images
MIT License
592 stars 76 forks source link

why gif become blurry after run "compress_images.js" #67

Open kousuanmd5 opened 2 years ago

kousuanmd5 commented 2 years ago

i use a 16M gif to compress , but the result gif is so blurry , How can I optimize it??

Yuriy-Svetlov commented 1 year ago

Hi, You need to refer to the documentation.

enginegif (type:plainObject): Engine for compressing gif and options for compression. Key to be gif;

engine (type:string): Engine for compressing gif. Possible values: gifsicle, giflossy, gif2webp; command (type:boolean|array): Options for compression. Can be false or commands type array. For gifsicle - To use this library you need to install it manually. It does not work properly on some OS. npm install gifsicle --save. Example options: ['--colors', '64', '--use-col=web'] or ['--optimize'] In details gifsicle; For giflossy - (For Linux x64 and Mac OS X) ['--lossy=80'] In details giflossy; For gif2webp - ['-f', '80', '-mixed', '-q', '30', '-m', '2'] in details gif2webp; Example:

  1. {gif: {engine: 'gifsicle', command: ['--colors', '64', '--use-col=web', '--scale', ' 0.8']}};
  2. {gif: {engine: 'giflossy', command: false}};
  3. {gif: {engine: 'gif2webp', command: ['-f', '80', '-mixed', '-q', '30', '-m', '2']}};