gifken
TypeScript icon, indicating that this package has built-in type declarations

3.0.4 • Public • Published

gifken

npm version FOSSA Status

How to use

Split an animated GIF image in browser

<script type="module">
  import {reverse, split} from 'gifken'

  const imageUrl = '/01_Koch-Kurve-Sechseck-alt._Def.-2.gif'
  const response = await fetch(imageUrl)
  const buffer = await response.arrayBuffer()

  const results = await split(new Uint8Array(buffer))
  for (const result of results) {
    const img = new Image()
    img.src = URL.createObjectURL(new Blob([result], {type: 'image/gif'}))
    document.body.append(img)
  }
</script>

Reverse an animated GIF image with Node.js

const {readFileSync, writeFileSync} = require('fs')
const gifken = require('gifken')

gifken
  .reverse(readFileSync('./assets/01_Koch-Kurve-Sechseck-alt._Def.-2.gif'))
  .then(result => {
    writeFileSync('reverse.gif', result)
  })

Build

To build gifken, following tools are required

  • Node.js >=14
  • npm >=8
  • Cargo
  • wasm-bindgen
git clone *thisrepo*
cd gifken
npm install
npm run build

Similar Projects

License

MIT

FOSSA Status

Readme

Keywords

Package Sidebar

Install

npm i gifken

Weekly Downloads

4

Version

3.0.4

License

MIT

Unpacked Size

442 kB

Total Files

10

Last publish

Collaborators

  • aaharu