Millisecond anime upscaling.
npm install anime4kRead more about how it works here: https://github.com/bloc97/Anime4K
npm i --save anime4kconst Anime4K = require('anime4k')Anime4K.Scaler(gl) where gl is a WebGL canvas context.js
// [For webpack, parcel, etc] Require Anime4K
const Anime4K = require('anime4k')// Create a canvas
const canvas = document.createElement('canvas')
document.body.appendChild(canvas)
// Create the scaler
const scaler = Anime4K.Scaler(canvas.getConext('webgl'))
// Create an image to scale
const inputImg = new Image()
// When the image has loaded, scale it.
inputImg.onLoad = function() {
scaler.inputImage(inputImg)
scaler.resize(2.0) // 2x scale
}
// Load the image
inputImg.src = 'some_image.png'
``