{"_id":"@bitruvius/turbo-webp","_rev":"20-b7adc2fb30bb4be5556766d20e559ea4","name":"@bitruvius/turbo-webp","dist-tags":{"latest":"0.3.3"},"versions":{"0.3.0":{"name":"@bitruvius/turbo-webp","version":"0.3.0","keywords":["bitruvius","geospatial","webgl2","webp","image","wasm","decoder"],"license":"SEE LICENSE IN LICENSE","_id":"@bitruvius/turbo-webp@0.3.0","maintainers":[{"name":"geoffhtaylor3d","email":"geoffhtaylor3d@gmail.com"},{"name":"danrhedges","email":"danrhedges@gmail.com"}],"homepage":"https://dev.bitruvius.com/sdks/js/","bugs":{"url":"https://github.com/bitruvius/support"},"dist":{"shasum":"6cbf9509b3343c031f17204a59f5fb34389ca901","tarball":"https://registry.npmjs.org/@bitruvius/turbo-webp/-/turbo-webp-0.3.0.tgz","fileCount":11,"integrity":"sha512-6V7T5Kbp9rhkPR2Vc17hRvUnpX1+MNe6Tx+QMHf7BAqNTuxmLKJqJQDvSSAwjpdPFEIN1NSH8GS3RN0J6B3POQ==","signatures":[{"sig":"MEUCIQDD3jKks8Qt1VRIDRZjzEnwtlHgmjSx3YrNOOFls2csJwIgZ8fgNTGDVHRrBsDjl9JOgDSuyer8RXQ3Ucz9Qxk8ejE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":269378},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"6cbf9509b3343c031f17204a59f5fb34389ca901","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./wasm/*":"./wasm/*","./package.json":"./package.json"},"scripts":{"test":"bun test","build":"bun build ./src/index.ts --outdir dist --format esm --target browser --minify --external '@bitruvius/*' --define __dirname='\"\"' --define __filename='\"\"' && tsc --emitDeclarationOnly"},"_npmUser":{"name":"geoffhtaylor3d","email":"geoffhtaylor3d@gmail.com"},"_integrity":"sha512-6V7T5Kbp9rhkPR2Vc17hRvUnpX1+MNe6Tx+QMHf7BAqNTuxmLKJqJQDvSSAwjpdPFEIN1NSH8GS3RN0J6B3POQ==","_npmVersion":"10.8.3","description":"TurboWebP: WebP image decoder for the browser, pure-Rust wasm","directories":{},"sideEffects":["./src/index.ts"],"_nodeVersion":"24.3.0","dependencies":{"@bitruvius/foundation":"^0.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/turbo-webp_0.3.0_1785722140215_0.29862962060802967","host":"s3://npm-registry-packages-npm-production"}},"0.3.1":{"name":"@bitruvius/turbo-webp","version":"0.3.1","keywords":["bitruvius","geospatial","webgl2","webp","image","wasm","decoder"],"license":"SEE LICENSE IN LICENSE","_id":"@bitruvius/turbo-webp@0.3.1","maintainers":[{"name":"geoffhtaylor3d","email":"geoffhtaylor3d@gmail.com"},{"name":"danrhedges","email":"danrhedges@gmail.com"}],"homepage":"https://dev.bitruvius.com/sdks/js/","bugs":{"url":"https://github.com/bitruvius/support"},"dist":{"shasum":"3f8524edf78e51f815f9c402fa5889318794636a","tarball":"https://registry.npmjs.org/@bitruvius/turbo-webp/-/turbo-webp-0.3.1.tgz","fileCount":11,"integrity":"sha512-r/FCMJ5j3kqsmujkXR9f06HQulTmO4e0rg8pjbI2e/5pDTaVOmAFucKO3x4qv+LatxFUaLBskitVicLjWR2OUQ==","signatures":[{"sig":"MEUCIHLnkvNKbgUNuY94wfKvIABVvwglGfLYWJqchcBRRZ0FAiEAjB/idRlsUaEkuCeMzGwu5ZOxUUcapshQddzHeffouUM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":269556},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"3f8524edf78e51f815f9c402fa5889318794636a","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./wasm/*":"./wasm/*","./package.json":"./package.json"},"scripts":{"test":"bun test","build":"bun build ./src/index.ts --outdir dist --format esm --target browser --minify --external '@bitruvius/*' --define __dirname='\"\"' --define __filename='\"\"' && tsc --emitDeclarationOnly"},"_npmUser":{"name":"geoffhtaylor3d","email":"geoffhtaylor3d@gmail.com"},"_integrity":"sha512-r/FCMJ5j3kqsmujkXR9f06HQulTmO4e0rg8pjbI2e/5pDTaVOmAFucKO3x4qv+LatxFUaLBskitVicLjWR2OUQ==","_npmVersion":"10.8.3","description":"TurboWebP: WebP image decoder for the browser, pure-Rust wasm","directories":{},"sideEffects":["./src/index.ts"],"_nodeVersion":"24.3.0","dependencies":{"@bitruvius/foundation":"^0.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/turbo-webp_0.3.1_1785725515511_0.2305433077240593","host":"s3://npm-registry-packages-npm-production"}},"0.3.2":{"name":"@bitruvius/turbo-webp","version":"0.3.2","keywords":["bitruvius","geospatial","webgl2","webp","image","wasm","decoder"],"license":"SEE LICENSE IN LICENSE","_id":"@bitruvius/turbo-webp@0.3.2","maintainers":[{"name":"geoffhtaylor3d","email":"geoffhtaylor3d@gmail.com"},{"name":"danrhedges","email":"danrhedges@gmail.com"}],"homepage":"https://dev.bitruvius.com/sdks/js/","bugs":{"url":"https://github.com/bitruvius/support"},"dist":{"shasum":"1a1ab935ce496b460f4d8182b0e33fc6db892b39","tarball":"https://registry.npmjs.org/@bitruvius/turbo-webp/-/turbo-webp-0.3.2.tgz","fileCount":11,"integrity":"sha512-67IvqCDYqbAjqmG5SYaCpA/zpktTkhRSCvKSNo72VsUnQjwT7RwwrvmVANUH4nRz49Qj82Iie99g48hKIX06TQ==","signatures":[{"sig":"MEUCIQCAoF5jBE+Xx3TAzvxIjlmAFTwkdJ0WeuPcmRDnfS1LHwIgatFFv8ReaZnV1BGK1tDTRJ/Gym2l9HWvjmCobWPoWUg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":269556},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"1a1ab935ce496b460f4d8182b0e33fc6db892b39","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./wasm/*":"./wasm/*","./package.json":"./package.json"},"scripts":{"test":"bun test","build":"bun build ./src/index.ts --outdir dist --format esm --target browser --minify --external '@bitruvius/*' --define __dirname='\"\"' --define __filename='\"\"' && tsc --emitDeclarationOnly"},"_npmUser":{"name":"geoffhtaylor3d","email":"geoffhtaylor3d@gmail.com"},"_integrity":"sha512-67IvqCDYqbAjqmG5SYaCpA/zpktTkhRSCvKSNo72VsUnQjwT7RwwrvmVANUH4nRz49Qj82Iie99g48hKIX06TQ==","_npmVersion":"10.8.3","description":"TurboWebP: WebP image decoder for the browser, pure-Rust wasm","directories":{},"sideEffects":["./src/index.ts"],"_nodeVersion":"24.3.0","dependencies":{"@bitruvius/foundation":"^0.3.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/turbo-webp_0.3.2_1785952484209_0.922120740400312","host":"s3://npm-registry-packages-npm-production"}},"0.3.3":{"_id":"@bitruvius/turbo-webp@0.3.3","bugs":{"url":"https://github.com/bitruvius/support"},"dist":{"shasum":"4102fa1b9b23cf74cf8cfce6ce8f9fb4565bbe75","tarball":"https://registry.npmjs.org/@bitruvius/turbo-webp/-/turbo-webp-0.3.3.tgz","fileCount":11,"integrity":"sha512-VfZ5hK8JEtw+xCKmMdujoyQB8HRYe5GJOXtt73jDbFIEMeGDm+AUuBBghJ1XmycnijAodEEJ2oBafPxM6SUjrg==","signatures":[{"sig":"MEQCIGd88CvSQt0R4wCsmqoxV0rCPZKZOYbNxw/Ds38gsZe7AiAmNW6poVForr32+5ejU0TExu27ThuMrcWD8RRCkyC7EA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCuNkANo4L145ngQL7ILdNDWsfDnenh2YdbBnofLvrzGwIhAI0VVpvQhXVkGayEqEsJREG7mR6tciYh/lLDI9+ls3Xp"}],"unpackedSize":279916},"main":"./dist/index.js","name":"@bitruvius/turbo-webp","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"4102fa1b9b23cf74cf8cfce6ce8f9fb4565bbe75","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./wasm/*":"./wasm/*","./package.json":"./package.json"},"license":"SEE LICENSE IN LICENSE","scripts":{"test":"bun test","build":"bun build ./src/index.ts --outdir dist --format esm --target browser --minify --external '@bitruvius/*' --define __dirname='\"\"' --define __filename='\"\"' && tsc --emitDeclarationOnly"},"version":"0.3.3","_npmUser":{"name":"geoffhtaylor3d","email":"geoffhtaylor3d@gmail.com"},"homepage":"https://dev.bitruvius.com/sdks/js/","keywords":["bitruvius","geospatial","webgl2","webp","image","wasm","decoder"],"_integrity":"sha512-VfZ5hK8JEtw+xCKmMdujoyQB8HRYe5GJOXtt73jDbFIEMeGDm+AUuBBghJ1XmycnijAodEEJ2oBafPxM6SUjrg==","_npmVersion":"10.8.3","description":"TurboWebP: WebP image decoder for the browser, pure-Rust wasm","directories":{},"maintainers":[{"name":"geoffhtaylor3d","email":"geoffhtaylor3d@gmail.com"},{"name":"danrhedges","email":"danrhedges@gmail.com"}],"sideEffects":["./src/index.ts"],"_nodeVersion":"24.3.0","dependencies":{"@bitruvius/foundation":"^0.3.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/turbo-webp_0.3.3_1790299999559_0.7597809000299816"}}},"time":{"created":"2026-08-03T01:55:40.041Z","modified":"2026-09-25T01:33:19.840Z","0.2.0-alpha.0":"2026-06-12T04:19:55.062Z","0.2.0-alpha.1":"2026-06-12T13:08:20.852Z","0.2.0-alpha.2":"2026-06-12T14:55:00.352Z","0.2.0-alpha.3":"2026-06-17T04:39:34.026Z","0.2.0-alpha.4":"2026-06-18T01:20:33.752Z","0.3.0":"2026-08-03T01:55:40.376Z","0.3.1":"2026-08-03T02:51:55.651Z","0.3.2":"2026-08-05T17:54:44.371Z","0.3.3":"2026-09-25T01:33:19.656Z"},"bugs":{"url":"https://github.com/bitruvius/support"},"license":"SEE LICENSE IN LICENSE","homepage":"https://dev.bitruvius.com/sdks/js/","keywords":["bitruvius","geospatial","webgl2","webp","image","wasm","decoder"],"description":"TurboWebP: WebP image decoder for the browser, pure-Rust wasm","maintainers":[{"name":"geoffhtaylor3d","email":"geoffhtaylor3d@gmail.com"},{"name":"danrhedges","email":"danrhedges@gmail.com"}],"readme":"<p align=\"center\">\n  <a href=\"https://bitruvius.com\"><img src=\"https://cdn.bitruvius.com/brand/bitruvius-logo.png\" width=\"360\" alt=\"Bitruvius\"></a>\n</p>\n\n# @bitruvius/turbo-webp\n\n**WebP decode in the browser. Byte-identical to libwebp, without libwebp.**\n\nYour existing WebP files, your existing pipeline, your existing tooling. Swap\nthe decoder implementation and keep everything else: decoded RGBA bytes are\nbyte-identical to libwebp on every input.\n\n> **Turbocharged by [Bitruvius TurboWebP](https://bitruvius.com/turbo-webp).**\n\n## Why it is faster\n\nlibwebp's lossy decode path has been frozen at SSE2/SSE4.1 since around 2012,\nand AVX2 only landed for the lossless path in libwebp 1.6.0. TurboWebP is a\nfrom-scratch Rust codec with current SIMD on every target it ships to.\n\nBitruvius' summary of the decode result: \"Decode the same files. Get there ~20%\nfaster.\"\n\n| Tile size | Decode speedup vs libwebp 1.6.0, Win AVX2 |\n|---|---|\n| 256² | 1.03× |\n| 512² | 1.20× |\n| 1024² | 1.23× |\n| 2048² | 1.24× |\n\nPooled decode over a 400-sample real-world geospatial and EO corpus, n=100 per\ntile size, files produced by libwebp m=6, measured on Win AVX2 (Intel Core Ultra\n9). Counting every cell in the published matrix: 27 of 32 decode cells faster on\nWin AVX2, 20 of 32 on Mac NEON (Apple M3 Max), 47 of 64 cross-host. Those\nfigures are measured on the native builds. This package is the same codec\ncompiled to WASM SIMD128.\n\n**Memory-safe implementation.** The codec is Rust, not C, so it removes the\nCVE-2023-4863 risk class rather than only the bugs that have been patched so\nfar. Bitruvius reports the `turbowebp-safe` implementation as zero-unsafe. No\nemscripten anywhere in the build.\n\n## Use it\n\n```ts\nimport { WebpDecoder } from '@bitruvius/turbo-webp';\n\nconst decoder = new WebpDecoder();\nconst img = await decoder.decode(bytes); // bytes: Uint8Array of a .webp file\n\n// img.rgba is RGBA8, length img.width * img.height * 4\nconst pixels = new ImageData(new Uint8ClampedArray(img.rgba), img.width, img.height);\n```\n\nThat is the whole API. `decode()` returns `{ width, height, hasAlpha, rgba }`.\nConstruct the decoder once and reuse it; the wasm initializes on the first\ndecode and is shared from there.\n\nServing the wasm yourself, from a CDN or a cross-origin host:\n\n```ts\nconst decoder = new WebpDecoder({\n  wasmInit: { wasmUrl: 'https://cdn.example.com/turbowebp_wasm_bg.wasm' },\n});\n```\n\nThe wasm is a process-wide singleton, so the first decode wins: whichever\ndecoder decodes first supplies the `wasmInit` that takes effect.\n\n## What ships\n\n```sh\nnpm i @bitruvius/turbo-webp\n```\n\n**Decoder only.** This package decodes WebP. It does not encode. TurboWebP's\nencoder is part of the native library, not this browser build, so do not plan a\nwrite path around this dependency.\n\n**Every still-image bitstream family decodes:** lossy `VP8 `, lossless `VP8L`,\nand the extended `VP8X` container with an `ALPH` alpha chunk. That matrix is\nasserted against the shipped wasm in `src/webp-conformance.test.ts`, over\nfixtures encoded by libwebp 1.6.0. Animated WebP\n(`ANIM`/`ANMF`) is not supported and rejects.\n\nThe wasm is committed to the package, so there is nothing to download at build\ntime. The one runtime dependency is `@bitruvius/foundation`, installed with it.\nAllow `script-src 'wasm-unsafe-eval'` in your CSP. A self-contained ESM bundle\nand a script-tag build are also published on the Bitruvius CDN if you would\nrather skip the bundler entirely.\n\n## Learn more\n\n- **[Live examples](https://dev.bitruvius.com/bitruvius-sdk-js/examples/)**: running, with source\n- **[Documentation](https://dev.bitruvius.com/sdks/js/)**: guides and the full API reference\n- **[Support](https://github.com/bitruvius/support)**: questions and issues\n- **[TurboWebP on bitruvius.com](https://bitruvius.com/turbo-webp)**: full benchmark matrix and format details\n\n## Trademarks\n\nWebP is a trademark of Google LLC. Google and libwebp are trademarks of Google\nLLC. Intel and Intel Core are trademarks of Intel Corporation. Apple is a\ntrademark of Apple Inc. Arm and Neon are trademarks of Arm Limited. Rust is a\ntrademark of the Rust Foundation. All other marks are the property of their\nrespective owners.\n\nThese names are used solely to describe the data formats this software\ninteroperates with, the hardware the published figures were measured on, and the\nlanguage it is written in. Bitruvius is not affiliated with, sponsored by, or\nendorsed by any of them, and no such relationship is implied.\n\n## License\n\nProprietary. The full terms ship as `LICENSE` inside this package, and are readable\nbefore installing at [cdn.bitruvius.com/legal/sdk-license-v1.txt](https://cdn.bitruvius.com/legal/sdk-license-v1.txt).\n\n© Bitruvius, Inc.\n","readmeFilename":"README.md"}