forked from external-repos/squoosh
Implement sRGB color conversion (#510)
* Add sRGB -> RGB conversion before resize * Add clamping for color space conversions * Clip for demultiplication as well * Fixing linear <-> srgb conversion * Update benchmark * Decouple srgb calculations * Generate lookup tables * Update src/codecs/resize/options.tsx * Defaulting on, renaming, removing redundant state
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), opts.premultiply,
|
||||
resizeMethods.indexOf(opts.method), opts.premultiply, opts.linearRGB,
|
||||
);
|
||||
|
||||
return new ImageData(new Uint8ClampedArray(result.buffer), opts.width, opts.height);
|
||||
|
||||
Reference in New Issue
Block a user