Socket
Socket
Sign inDemoInstall

@ibaraki-douji/anime4k-gif

Package Overview
Dependencies
36
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @ibaraki-douji/anime4k-gif

Upscale GIFs using Anime4kCPP


Version published
Weekly downloads
36
increased by1700%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Anime4k GIF

A simple GIF upscaler using anime-4k-cpp
And my other lib anime4k

Getting started

npm i @ibaraki-douji/anime4k-gif --save

Usage

Import the lib

const anime4kgif = require('@ibaraki-douji/anime4k-gif')

Start Upscale

const anime4kgif = require('@ibaraki-douji/anime4k-gif')

const input = "./path/to/gif";
//const input = readFileSync('./path/to/gif'); // <- Buffer
const output = "./path/to/upscaled/gif";
//const output = "" // <- IF BufferOutput Option

const options = {
    /**
     * Threads
     * -t
     */
    threads: 16,
    /**
     * Upscale Multiplier
     * -z
     */
    scale: 2,
    /**
     * Choose GPU
     * -q
     */
    gpu: true,

    outputAsBuffer: true
}

anime4kgif.upscale(input, output, options);

Wait the end

const anime4kgif = require('@ibaraki-douji/anime4k-gif')
const upscale = anime4kgif.upscale(input, output, options);

upscale.finishedPromise().then(() => {
    console.log("Finished")
})

Get Buffer at End

const anime4kgif = require('@ibaraki-douji/anime4k-gif')
const upscale = anime4kgif.upscale(input, output, options);

upscale.finishedPromise().then(() => {
    writeFileSync("./buffer.gif", upscale.endBuffer);
})

List yours GPUs

const anime4kgif = require('@ibaraki-douji/anime4k-gif')
anime4kgif.listGPUs().then(console.log)

Exemple

const anime4kgif = require('@ibaraki-douji/anime4k-gif')
// npm i axios
const axios = require('axios').default

// MAKE A ASYNC FUNCTION AT START
(async () => {
    const upscale = anime4kgif.upscale((await axios.get('https://cdn.discordapp.com/attachments/770019121349001227/874597329594892338/in.gif')).data, "./output.gif", {
        upscale: 2,
        noise: 0
    });
    await upscale.finishedPromise()
    console.log("Finished");
})()

More Help and Support

Discord : https://discord.gg/mD9c4zP4Er

Ask me what you want in the Discord server

Keywords

FAQs

Last updated on 12 Aug 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc