forked from external-repos/squoosh
Implement alpha premultiplication (#507)
* Implement alpha premultiplication * Add benchmark to resize * Only display "Premultiply alpha" if it's one of the rust resize types. * Add comment about division by zero
This commit is contained in:
@@ -45,7 +45,7 @@ export async function resize(data: ImageData, opts: WorkerResizeOptions): Promis
|
||||
|
||||
const result = wasm_bindgen.resize(
|
||||
new Uint8Array(input.data.buffer), input.width, input.height, opts.width, opts.height,
|
||||
resizeMethods.indexOf(opts.method),
|
||||
resizeMethods.indexOf(opts.method), opts.premultiply,
|
||||
);
|
||||
|
||||
return new ImageData(new Uint8ClampedArray(result.buffer), opts.width, opts.height);
|
||||
|
||||
Reference in New Issue
Block a user