diff --git a/mod.ts b/mod.ts index 50663a9..4355de5 100644 --- a/mod.ts +++ b/mod.ts @@ -60,8 +60,13 @@ export function encode( depth?: ValueOf; compression?: ValueOf; filter?: ValueOf; + stripAlpha?: boolean }, ): Uint8Array { + if (options?.stripAlpha) { + image = image.filter((_, i) => (i + 1) % 4); + } + return wasmEncode( image, width,