Home

Awesome

<p align="left"> En | <a href="./README_CN.md">简体中文</a> </p> <p align="center"> <img src="./docs/icon.png" width="100"> </p> <h1 align="center">Gifsicle Wasm Browser</h1> <p align="center"> <a href="https://www.npmjs.com/package/gifsicle-wasm-browser"> <img align="center" src="https://img.shields.io/npm/v/gifsicle-wasm-browser.svg?style=flat-square" height=17> </a> <a href="https://unpkg.com/gifsicle-wasm-browser/dist/gifsicle.min.js"> <img align="center" src="https://img.shields.io/bundlephobia/minzip/gifsicle-wasm-browser.svg?style=flat-square" height=17> </a> </p> <p align="center"> Run Gifsicle in your browser to compress, crop, frame, resize, and more on GIFs. </p> <p align="center"> <img align="center" src="./docs/images/ui.webp"> </p> <!-- # directory - [Function]() - [Demo]() - [Quick Start]() - [Api]() - [hint]() - [Browser support]() -->

Function

Demo

Basic usage

For more commands, please refer to the Gifsicle Manual.

<table> <tr> <th>Compression</th> <th>Action Frame</th> <th>Crop</th> <th>Size</th> <th>Other</th> </tr> <tr> <td> <a href="https://renzhezhilu.github.io/gifsicle-wasm-browser/?share=eyJpbnB1dCI6W3siZmlsZSI6Imh0dHBzOi8vbWVkaWEuZ2lwaHkuY29tL21lZGlhL0ROeGd1M3NnMldjdncwbUlDSy9naXBoeS5naWYiLCJuYW1lIjoiMS5naWYifV0sImNvbW1hbmQiOlt7InZhbHVlIjoiLU8xIC0tbG9zc3k9MjAgMS5naWYgIC1vIC9vdXQvb3V0LmdpZiJ9XSwiem9vbSI6MX0=">Low</a><br /> <a href="https://renzhezhilu.github.io/gifsicle-wasm-browser/?share=eyJpbnB1dCI6W3siZmlsZSI6Imh0dHBzOi8vbWVkaWEuZ2lwaHkuY29tL21lZGlhL0ROeGd1M3NnMldjdncwbUlDSy9naXBoeS5naWYiLCJuYW1lIjoiMS5naWYifV0sImNvbW1hbmQiOlt7InZhbHVlIjoiLU8yIC0tbG9zc3k9NDAgMS5naWYgIC1vIC9vdXQvb3V0LmdpZiJ9XSwiem9vbSI6MX0=">middle</a> <br /> <a href="https://renzhezhilu.github.io/gifsicle-wasm-browser/?share=eyJpbnB1dCI6W3siZmlsZSI6Imh0dHBzOi8vbWVkaWEuZ2lwaHkuY29tL21lZGlhL0ROeGd1M3NnMldjdncwbUlDSy9naXBoeS5naWYiLCJuYW1lIjoiMS5naWYifV0sImNvbW1hbmQiOlt7InZhbHVlIjoiLU8zIC0tbG9zc3k9MTYwIDEuZ2lmICAtbyAvb3V0L291dC5naWYifV0sInpvb20iOjF9">high</a> <br /><br /><br /><br /><br /><br /><br /> </td> <td> <a href="https://renzhezhilu.github.io/gifsicle-wasm-browser/?share=eyJpbnB1dCI6W3siZmlsZSI6Imh0dHBzOi8vbWVkaWEuZ2lwaHkuY29tL21lZGlhL0ZHZzRkQjZqWlFZdFcvZ2lwaHkuZ2lmIiwibmFtZSI6IjEuZ2lmIn1dLCJjb21tYW5kIjpbeyJ2YWx1ZSI6IjEuZ2lmICMtMS0tMiAtbyAvb3V0L291dC5naWYifV0sInpvb20iOjF9">Select the last 2 frames</a><br /> <a href="https://renzhezhilu.github.io/gifsicle-wasm-browser/?share=eyJpbnB1dCI6W3siZmlsZSI6Imh0dHBzOi8vbWVkaWEyLmdpcGh5LmNvbS9tZWRpYS8xM0NvWERpYUNjQ295ay8yMDAuZ2lmIiwibmFtZSI6IjEuZ2lmIn1dLCJjb21tYW5kIjpbeyJ2YWx1ZSI6IjEuZ2lmICMwLTIgIy0xLS0zICAtbyAvb3V0L291dC5naWYifV0sInpvb20iOjF9">Select 3 frames before and after</a><br /> <a href="https://renzhezhilu.github.io/gifsicle-wasm-browser/?share=eyJpbnB1dCI6W3siZmlsZSI6Imh0dHBzOi8vbWVkaWEyLmdpcGh5LmNvbS9tZWRpYS8xM0NvWERpYUNjQ295ay8yMDAuZ2lmIiwibmFtZSI6IjEuZ2lmIn1dLCJjb21tYW5kIjpbeyJ2YWx1ZSI6IjEuZ2lmIC0tZGVsZXRlICMwLTIwIC1vIC9vdXQvb3V0LmdpZiJ9XSwiem9vbSI6MX0=">delete the first 20 frames</a><br /> <a href="https://renzhezhilu.github.io/gifsicle-wasm-browser/?share=eyJpbnB1dCI6W3siZmlsZSI6Imh0dHBzOi8vbWVkaWEyLmdpcGh5LmNvbS9tZWRpYS8xM0NvWERpYUNjQ295ay8yMDAuZ2lmIiwibmFtZSI6IjEuZ2lmIn0seyJmaWxlIjoiaHR0cHM6Ly9tZWRpYTIuZ2lwaHkuY29tL21lZGlhL05tOFpQQUdPd1pVUU0vMjAwLmdpZiIsIm5hbWUiOiIyLmdpZiJ9XSwiY29tbWFuZCI6W3sidmFsdWUiOiItYiAtLXJlc2l6ZSAyNDF4MjAwIDIuZ2lmIn0seyJ2YWx1ZSI6IiAxLmdpZiAtLXJlcGxhY2UgIzItNSAgMi5naWYgICAtbyAvb3V0L291dC5naWYifV0sInpvb20iOjF9">Replace 3-6 frames with other GIFs</a><br /> <a href="https://renzhezhilu.github.io/gifsicle-wasm-browser/?share=eyJpbnB1dCI6W3siZmlsZSI6Imh0dHBzOi8vbWVkaWEuZ2lwaHkuY29tL21lZGlhLzF5QzJnZUJtSkpiaE1XYnl5Ni9naXBoeS5naWYiLCJuYW1lIjoiMS5naWYifV0sImNvbW1hbmQiOlt7InZhbHVlIjoiMS5naWYgIy0xLTAgICAtbyAvb3V0L291dDEuZ2lmIn0seyJ2YWx1ZSI6Ii1VIDEuZ2lmICMtMS0wICAgLW8gL291dC9vdXQyLmdpZiJ9XSwiem9vbSI6IjAuOSJ9">rewind</a><br /> <a href="https://renzhezhilu.github.io/gifsicle-wasm-browser/?share=eyJpbnB1dCI6W3siZmlsZSI6Imh0dHBzOi8vbWVkaWEuZ2lwaHkuY29tL21lZGlhL25qT04zakVtVFlIRWZSYmZzay8yMDAuZ2lmIiwibmFtZSI6IjIuZ2lmIn0seyJmaWxlIjoiaHR0cHM6Ly9tZWRpYS5naXBoeS5jb20vbWVkaWEvSXAzckk4VzFZY1hITzVNeUhRL2dpcGh5LmdpZiIsIm5hbWUiOiIxLmdpZiJ9XSwiY29tbWFuZCI6W3sidmFsdWUiOiItYiAgLVUgICAtLXJlc2l6ZSAxMDB4MTAwIDEuZ2lmIn0seyJ2YWx1ZSI6Ii1iICAtVSAgLS1yZXNpemUgMTAweDEwMCAyLmdpZiAifSx7InZhbHVlIjoiLVUgIFxuMS5naWYgLS1hcHBlbmQgIzAgIDIuZ2lmICMwIFxuMS5naWYgLS1hcHBlbmQgIzEgIDIuZ2lmICMxIFxuMS5naWYgLS1hcHBlbmQgIzIgIDIuZ2lmICMyIFxuMS5naWYgICAgLS1hcHBlbmQgIzMgIDIuZ2lmICMzIFxuMS5naWYgIC0tYXBwZW5kICM0ICAyLmdpZiAjNCBcbjEuZ2lmICAtLWFwcGVuZCAjNSAgMi5naWYgIzUgXG4tbyAvb3V0L291dC5naWYifV0sInpvb20iOiIwLjkifQ==">Alternate 2 GIFs</a><br /> <a href="https://renzhezhilu.github.io/gifsicle-wasm-browser/?share=eyJpbnB1dCI6W3siZmlsZSI6Imh0dHBzOi8vbWVkaWEuZ2lwaHkuY29tL21lZGlhL2hUaDliU2JVUFdNV2svZ2lwaHkuZ2lmIiwibmFtZSI6IjEuZ2lmIn1dLCJjb21tYW5kIjpbeyJ2YWx1ZSI6Ii1lIC1VIDEuZ2lmICAtbyAvb3V0L291dC5naWYifV0sInpvb20iOiIwLjYifQ==">export all frames</a><br /> <br /> <br /> <br /> </td> <td> <a href="https://renzhezhilu.github.io/gifsicle-wasm-browser/?share=eyJpbnB1dCI6W3siZmlsZSI6Imh0dHBzOi8vbWVkaWE0LmdpcGh5LmNvbS9tZWRpYS9uUjRMMTBYbEpjU2VRLzIwMC5naWYiLCJuYW1lIjoiMS5naWYifV0sImNvbW1hbmQiOlt7InZhbHVlIjoiLS1jcm9wIDMwLDAtMTgwLDExMCAxLmdpZiAgLW8gL291dC9vdXQuZ2lmIn1dLCJ6b29tIjoxfQ==">According to the upper left and lower right corners</a><br /> <a href="https://renzhezhilu.github.io/gifsicle-wasm-browser/?share=eyJpbnB1dCI6W3siZmlsZSI6Imh0dHBzOi8vbWVkaWE0LmdpcGh5LmNvbS9tZWRpYS9uUjRMMTBYbEpjU2VRLzIwMC5naWYiLCJuYW1lIjoiMS5naWYifV0sImNvbW1hbmQiOlt7InZhbHVlIjoiLS1jcm9wIDMwLDArMTUweDExMCAxLmdpZiAgLW8gL291dC9vdXQuZ2lmIn1dLCJ6b29tIjoxfQ==">According to the upper left corner and height and width</a><br /> <a href="https://renzhezhilu.github.io/gifsicle-wasm-browser/?share=eyJpbnB1dCI6W3siZmlsZSI6Imh0dHBzOi8vbWVkaWE0LmdpcGh5LmNvbS9tZWRpYS9uUjRMMTBYbEpjU2VRLzIwMC5naWYiLCJuYW1lIjoiMS5naWYifV0sImNvbW1hbmQiOlt7InZhbHVlIjoiLS1yb3RhdGUtOTAgLS1jcm9wIDUwLDArMTAweDEwMCAxLmdpZiBcbi1vIC9vdXQvcm90YXRlLT5jcm9wLmdpZiJ9XSwiem9vbSI6MX0=">Crop after rotation</a><br /> <a href="https://renzhezhilu.github.io/gifsicle-wasm-browser/?share=eyJpbnB1dCI6W3siZmlsZSI6Imh0dHBzOi8vbWVkaWE0LmdpcGh5LmNvbS9tZWRpYS9uUjRMMTBYbEpjU2VRLzIwMC5naWYiLCJuYW1lIjoiMS5naWYifV0sImNvbW1hbmQiOlt7InZhbHVlIjoiLS1jcm9wIDUwLDArMTAweDEwMCAxLmdpZiBcbi1vIC9vdXQvbm90LWZsaXAuZ2lmIn0seyJ2YWx1ZSI6Ii0tZmxpcC1ob3Jpem9udGFsIC0tY3JvcCA1MCwwKzEwMHgxMDAgMS5naWYgXG4tbyAvb3V0L2ZsaXAuZ2lmIn1dLCJ6b29tIjoxfQ==">Crop after flip</a><br /> <a href="https://renzhezhilu.github.io/gifsicle-wasm-browser/?share=eyJpbnB1dCI6W3siZmlsZSI6Imh0dHBzOi8vbWVkaWEuZ2lwaHkuY29tL21lZGlhL0ZHZzRkQjZqWlFZdFcvZ2lwaHkuZ2lmIiwibmFtZSI6IjEuZ2lmIn1dLCJjb21tYW5kIjpbeyJ2YWx1ZSI6Ii1iIC0tY3JvcC10cmFuc3BhcmVuY3kgIDEuZ2lmIn0seyJ2YWx1ZSI6Ii1iIC0tcm90YXRlLTE4MCAgIDEuZ2lmIn0seyJ2YWx1ZSI6Ii0tcm90YXRlLTE4MCAtLWNyb3AtdHJhbnNwYXJlbmN5IFxuMS5naWYgIC1vIC9vdXQvb3V0LmdpZiJ9XSwiem9vbSI6MX0=">Cut out excess transparency</a><br /> <br /> <br /><br /><br /> </td> <td> <a href="https://renzhezhilu.github.io/gifsicle-wasm-browser/?share=eyJpbnB1dCI6W3siZmlsZSI6Imh0dHBzOi8vbWVkaWEuZ2lwaHkuY29tL21lZGlhL0ZHZzRkQjZqWlFZdFcvZ2lwaHkuZ2lmIiwibmFtZSI6IjEuZ2lmIn1dLCJjb21tYW5kIjpbeyJ2YWx1ZSI6Ii0tcmVzaXplIDEwMHhfXG4xLmdpZiAgLW8gL291dC9vdXQuZ2lmXG4ifV0sInpvb20iOjF9">Modify the width to 100px</a><br /> <a href="https://renzhezhilu.github.io/gifsicle-wasm-browser/?share=eyJpbnB1dCI6W3siZmlsZSI6Imh0dHBzOi8vbWVkaWEuZ2lwaHkuY29tL21lZGlhL0ZHZzRkQjZqWlFZdFcvZ2lwaHkuZ2lmIiwibmFtZSI6IjEuZ2lmIn1dLCJjb21tYW5kIjpbeyJ2YWx1ZSI6Ii0tc2NhbGUgMC41XG4xLmdpZiAgLW8gL291dC9vdXQuZ2lmXG4ifV0sInpvb20iOjF9">Shrink by 50%</a><br /> <a href="https://renzhezhilu.github.io/gifsicle-wasm-browser/?share=eyJpbnB1dCI6W3siZmlsZSI6Imh0dHBzOi8vbWVkaWEuZ2lwaHkuY29tL21lZGlhL0ZHZzRkQjZqWlFZdFcvZ2lwaHkuZ2lmIiwibmFtZSI6IjEuZ2lmIn1dLCJjb21tYW5kIjpbeyJ2YWx1ZSI6Ii1TIDUwMHg1MDBcbjEuZ2lmICAtbyAvb3V0L291dDEuZ2lmXG4ifSx7InZhbHVlIjoiLVMgNTAweDUwMCAtcCAxMjAsMTIwXG4xLmdpZiAgLW8gL291dC9vdXQyLmdpZlxuIn1dLCJ6b29tIjoxfQ==">Modify aspect ratio</a><br /> <br /><br /><br /><br /><br /><br /><br /><br /> </td> <td> <a href="https://renzhezhilu.github.io/gifsicle-wasm-browser/?share=eyJpbnB1dCI6W3siZmlsZSI6Imh0dHBzOi8vbWVkaWEuZ2lwaHkuY29tL21lZGlhLzludVhSeDVFZkdzS2MvZ2lwaHkuZ2lmIiwibmFtZSI6IjEuZ2lmIn1dLCJjb21tYW5kIjpbeyJ2YWx1ZSI6Ii0tbG9vcGNvdW50PTEgMS5naWYgIC1vIC9vdXQvbG9vcC0xLmdpZiJ9LHsidmFsdWUiOiItLWxvb3Bjb3VudD0yIDEuZ2lmICAtbyAvb3V0L2xvb3AtMi5naWYifSx7InZhbHVlIjoiLS1sb29wY291bnQ9MCAxLmdpZiAgLW8gL291dC9sb29wLWZvcmV2ZXIuZ2lmIn1dLCJ6b29tIjoiMC43In0=">loop</a><br /> <a href="https://renzhezhilu.github.io/gifsicle-wasm-browser/?share=eyJpbnB1dCI6W3siZmlsZSI6Imh0dHBzOi8vbWVkaWEuZ2lwaHkuY29tL21lZGlhL0k1MWlnR0Nvc1pqOTB5M1Y5TC9naXBoeS5naWYiLCJuYW1lIjoiMS5naWYifV0sImNvbW1hbmQiOlt7InZhbHVlIjoiLS1pbmZvIDEuZ2lmICAtbyAvb3V0L2luZm8udHh0In1dLCJ6b29tIjoiMS41In0=">read info</a><br /> <a href="https://renzhezhilu.github.io/gifsicle-wasm-browser/?share=eyJpbnB1dCI6W3siZmlsZSI6Imh0dHBzOi8vbWVkaWEuZ2lwaHkuY29tL21lZGlhL0k1MWlnR0Nvc1pqOTB5M1Y5TC9naXBoeS5naWYiLCJuYW1lIjoiMS5naWYifSx7ImZpbGUiOiJodHRwczovL21lZGlhLmdpcGh5LmNvbS9tZWRpYS9uak9OM2pFbVRZSEVmUmJmc2svMjAwLmdpZiIsIm5hbWUiOiIyLmdpZiJ9LHsiZmlsZSI6Imh0dHBzOi8vbWVkaWEuZ2lwaHkuY29tL21lZGlhLzludVhSeDVFZkdzS2MvZ2lwaHkuZ2lmIiwibmFtZSI6IjMuZ2lmIn1dLCJjb21tYW5kIjpbeyJ2YWx1ZSI6Ii0tbWVyZ2UgMS5naWYgMi5naWYgMy5naWYgIC1vIC9vdXQvaW5mby5naWYifV0sInpvb20iOiIxLjEifQ==">merge</a><br /> <a href="https://renzhezhilu.github.io/gifsicle-wasm-browser/?share=eyJpbnB1dCI6W3siZmlsZSI6Imh0dHBzOi8vbWVkaWEuZ2lwaHkuY29tL21lZGlhL25qT04zakVtVFlIRWZSYmZzay8yMDAuZ2lmIiwibmFtZSI6IjEuZ2lmIn1dLCJjb21tYW5kIjpbeyJ2YWx1ZSI6Ii1kMTAwIDEuZ2lmIC1vIC9vdXQvMXMuZ2lmIn0seyJ2YWx1ZSI6Ii1kNTAgMS5naWYgLW8gL291dC8wLjVzLmdpZiJ9LHsidmFsdWUiOiItZDEwIDEuZ2lmIC1vIC9vdXQvMC4xcy5naWYifSx7InZhbHVlIjoiLWQzIDEuZ2lmIC1vIC9vdXQvMC4wM3MuZ2lmIn1dLCJ6b29tIjoiMC41In0=">Play speed</a><br /> <br /><br /><br /><br /> </td> <!-- <td> <a href="xx">xx</a><br /> <br /> <a href="xx">xx</a> <br /> <a href="xx">xx</a> <br /><br /><br /><br /><br /> </td> --> </tr> </table>

Complete example

gifsicleTool.js By combining multiple commands, it can complete more practical functions.

Quick start

npm install

import in vue

$ npm i gifsicle-wasm-browser --save
import gifsicle from "gifsicle-wasm-browser";

gifsicle.run({
  input: [{
      file: "./cat.gif",
      name: "1.gif",
  }],
  command: [`
    -e -U 
    --resize 100x_ 
    1.gif 
    -o /out/out.gif`],
})
.then(outGifFiles => {
  console.log(outGifFiles);
  // [File,File,File ...]
});

cdn

cdn demo

<script type="module">
  import gifsicle from 'https://unpkg.com/gifsicle-wasm-browser/dist/gifsical.min.js'
  // or
  import gifsicle from 'https://cdn.jsdelivr.net/npm/gifsicle-wasm-browser/dist/gifsicle.min.js'
      ...
  })
</script>

Api

gifsicle.run(input=[], command=[])

input

command

folder

isStrict

return

array of GIFs File

Tips

🦁️ Gif:little lion ears

gifsicle-wasm-browser Compression parameter graphic 02

<!-- ![gifsicle-wasm-browser Compression parameter graphic 01](https://user-images.githubusercontent.com/7707921/188500398-59093705-c766-4b81-8c62-10a851906119.gif) -->

Author

gifsicle-wasm-browser is @renzhezhilu at wasm-codecs/gifsicle and Developed on the basis of gifsicle.

To do