Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hex2f/anime4k
bloc97/Anime4K Implemented as an easy to use JS library.
https://github.com/hex2f/anime4k
Last synced: about 1 month ago
JSON representation
bloc97/Anime4K Implemented as an easy to use JS library.
- Host: GitHub
- URL: https://github.com/hex2f/anime4k
- Owner: hex2f
- Created: 2019-08-26T14:05:01.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-06-27T17:34:25.000Z (over 2 years ago)
- Last Synced: 2024-10-13T22:02:42.323Z (about 1 month ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 16
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Anime4K (for JS)
Millisecond anime upscaling with fantastic quality using GLSL shaders.Read more about how it works here: [https://github.com/bloc97/Anime4K](https://github.com/bloc97/Anime4K)
## How do i install it?
### In vanilla JS
Just load index.js from this repo.
### Using Webpack, Parcel, Etc.
Install it using `npm i --save anime4k`
and include it using `const Anime4K = require('anime4k')`## How do i use it?
To create a new scaler, run `Anime4K.Scaler(gl)` where `gl` is a WebGL canvas context.
### Example
```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.getContext('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'
```