# @imgly/background-removal v1.5.5 source and build information

ToolKnit distributes a self-hosted browser bundle of
`@imgly/background-removal` v1.5.5. The image-processing logic is not
modified. The published ESM entry and its pinned production dependencies are
rebundled so the browser can load the engine from ToolKnit without a runtime
CDN dependency.

## Corresponding source

- Upstream project: https://github.com/imgly/background-removal-js
- Exact source commit: c9f7e5cad4c6cb7ecb20585509f1f2a727fb3e7a
- Commit source tree: https://github.com/imgly/background-removal-js/tree/c9f7e5cad4c6cb7ecb20585509f1f2a727fb3e7a
- Source archive: https://github.com/imgly/background-removal-js/archive/c9f7e5cad4c6cb7ecb20585509f1f2a727fb3e7a.zip
- Published package: https://registry.npmjs.org/@imgly/background-removal/-/background-removal-1.5.5.tgz
- npm package integrity: `sha512-tULjwGmuPTUCWVQsP2KpSOEv7/mNGQhULM3WEe+eap1nmobGkQp3Gwj3gmVK7mw/b9FSzoM5nD4pJdvffYmr5A==`
- npm package SHA-256: `942b9683d10ad7f67d9447397359d111a43aa5276028afe1e090a7d6a81eb932`

The exact source commit contains the TypeScript source, package lock, and
upstream build scripts. IMG.LY licenses this version under GNU AGPL-3.0.

To rebuild the upstream ESM entry from the exact source commit, use Node
20.13.1 and npm 10.5.2, then run these commands from the repository root:

```sh
npm ci
npm run build --workspace @imgly/background-removal
```

The resulting `packages/web/dist/index.mjs` is 248,222 bytes with SHA-256
`a5e934701647d8447b13b28abde6e2c76b8803bbb63e16a02b2772e566af78a1`.
That file was verified as byte-for-byte identical to `dist/index.mjs` in the
published v1.5.5 npm package.

## ToolKnit bundle

- Distributed file: `background-removal.esm.js`
- Size: 1,418,970 bytes
- SHA-256: `92896f30d163bc3762ae80ea5eb308c91356e30ffc03ab872bcd534705ad8701`
- Module format: ESM
- JavaScript target: ES2020
- Bundler: esbuild 0.25.8
- Rebundle date: 2026-07-27

ToolKnit made no changes to the upstream TypeScript or published ESM logic.
Its distribution change is limited to resolving and bundling dependencies,
minification, and self-hosting the resulting ESM file and model resources.

## Rebuild the ToolKnit bundle

Create an empty directory and save this `package.json`:

```json
{
  "private": true,
  "dependencies": {
    "@imgly/background-removal": "1.5.5",
    "esbuild": "0.25.8",
    "iota-array": "1.0.0",
    "is-buffer": "1.1.6",
    "lodash-es": "4.17.21",
    "ndarray": "1.0.19",
    "onnxruntime-web": "1.18.0",
    "zod": "3.23.8"
  }
}
```

Install the pinned packages and build the browser bundle:

```sh
npm install
npx --no-install esbuild node_modules/@imgly/background-removal/dist/index.mjs \
  --bundle \
  --format=esm \
  --platform=browser \
  --target=es2020 \
  --minify \
  --legal-comments=eof \
  --outfile=background-removal.esm.js
```

This recipe was verified in a clean environment on 2026-08-05 and produced a
byte-for-byte identical 1,418,970-byte file with the SHA-256 shown above.

## Licenses and notices

- GNU AGPL-3.0 text: `LICENSE.md`
- Upstream third-party inventory: `ThirdPartyLicenses.json`
- Pinned package versions and artifact hash: `manifest.json`

The generated bundle retains bundled legal comments for included
dependencies. The upstream inventory identifies ONNX Runtime Web, the ISNET
model, Lodash, ndarray, and Zod. The pinned build also includes `iota-array`
1.0.0 and `is-buffer` 1.1.6, both MIT-licensed transitive dependencies.

Questions about this distribution can be sent to 2645149786@qq.com.
