Resize working

This commit is contained in:
Jake Archibald
2020-09-21 15:18:33 +01:00
parent 21fc70cbdd
commit 2a6a83f56d
4 changed files with 4 additions and 6 deletions

View File

@@ -31,8 +31,8 @@ async function demo() {
const data = ctx.getImageData(0, 0, img.width, img.height);
const result = await api.resize(data, {
fitMethod: 'stretch',
height: 20,
width: 20,
height: 200,
width: 200,
linearRGB: false,
premultiply: true,
method: 'lanczos3',
@@ -49,6 +49,7 @@ async function demo() {
canvas.height = result.height;
const ctx = canvas.getContext('2d')!;
ctx.putImageData(result, 0, 0);
document.body.append(canvas);
}
}