Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sapics/scale.js

High-quality scale function for canvas and image element. If scale factor < 1, then algorithm for downscale (area average) is used, other than that, bicubic algorithm is used.
https://github.com/sapics/scale.js

bicubic-algorithm canvas downscale image javascript scale

Last synced: 16 days ago
JSON representation

High-quality scale function for canvas and image element. If scale factor < 1, then algorithm for downscale (area average) is used, other than that, bicubic algorithm is used.

Awesome Lists containing this project

README

        

# scale.js
High-quality scale function for canvas and image element.
If scale factor < 1, then algorithm for downscale is used, other than that, bicubic algorithm is used.

## How to use
Please use dist/scale.min.js, because src/scale.js dose not work.








(function(){
var inputCanvas = document.getElementById("inputCanvas");
var inputImage = document.getElementById("inputImage");

var newCanvas1 = scale(0.7,
inputCanvas);
var newCanvas2 = scale({scaleX:1.7, scaleY:1.4},
inputImage,
document.getElementById("exportCanvas2"));
var jpegImage = scale({width:100, height:200},
inputCanvas,
'jpeg');
var pngSrc = scale(0.7,
inputCanvas,
'png-src');
})();

## Licence
MIT Licence