Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/sapics/scale.js
- Owner: sapics
- License: mit
- Created: 2015-04-11T10:45:37.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2020-07-13T06:02:37.000Z (over 4 years ago)
- Last Synced: 2024-10-14T12:53:41.032Z (30 days ago)
- Topics: bicubic-algorithm, canvas, downscale, image, javascript, scale
- Language: JavaScript
- Homepage:
- Size: 39.1 KB
- Stars: 50
- Watchers: 5
- Forks: 19
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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