{"_id":"pica-gpu","_rev":"6-7daf9f4e6d109cff3f6eafcd2e2cbdf6","name":"pica-gpu","dist-tags":{"latest":"0.2.0"},"versions":{"0.0.1":{"name":"pica-gpu","version":"0.0.1","keywords":["image","resize","webgl","gpu","canvas","typescript"],"author":{"name":"gezilinll"},"license":"MIT","_id":"pica-gpu@0.0.1","maintainers":[{"name":"gezilinll","email":"linbinghe@gmail.com"}],"homepage":"https://github.com/gezilinll/pica-gpu#readme","bugs":{"url":"https://github.com/gezilinll/pica-gpu/issues"},"dist":{"shasum":"06e1e09730767edfb173ada03a84fa25a3c01ce6","tarball":"https://registry.npmjs.org/pica-gpu/-/pica-gpu-0.0.1.tgz","fileCount":19,"integrity":"sha512-encLH5+IkhBndHzfhVkJHIDSogi1+m4xJbAl41qtrM4JqReUrOicSP0euN5dTmNnuUZghMPjO/r7a3qzIwQFTw==","signatures":[{"sig":"MEYCIQDmMCrvFgOaXSgFCTkyGd1YOpf7DaUbJ6yGjSEIWOwdMwIhALApY0AZi9UN4GqTZixFtgkOttyGnDz7QeY+igJ/7HP4","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32916},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","gitHead":"c5cafd13f686f6815a7ae80ffe43fc07ea805edf","scripts":{"dev":"tsc --watch","build":"tsc","publish":"npm publish --access public","prebuild":"rm -rf dist","prepublishOnly":"pnpm build"},"_npmUser":{"name":"gezilinll","email":"linbinghe@gmail.com"},"repository":{"url":"git+https://github.com/gezilinll/pica-gpu.git","type":"git"},"_npmVersion":"10.2.4","description":"A GPU-accelerated image resizing library using WebGL 2.0.","directories":{},"_nodeVersion":"20.11.1","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.2.2"},"_npmOperationalInternal":{"tmp":"tmp/pica-gpu_0.0.1_1741080393313_0.4208340394291239","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"pica-gpu","version":"0.0.2","keywords":["image","resize","webgl","gpu","canvas","typescript"],"author":{"name":"gezilinll"},"license":"MIT","_id":"pica-gpu@0.0.2","maintainers":[{"name":"gezilinll","email":"linbinghe@gmail.com"}],"homepage":"https://github.com/gezilinll/pica-gpu#readme","bugs":{"url":"https://github.com/gezilinll/pica-gpu/issues"},"dist":{"shasum":"ca315d01e9226a50b3558e4d96a0401188f52720","tarball":"https://registry.npmjs.org/pica-gpu/-/pica-gpu-0.0.2.tgz","fileCount":18,"integrity":"sha512-b74fxysiZgxm0Abo4FlBhjTe/YqCnqORnojSjmCkZHd5FvYxngvYa0KW3B5/IS89GnPKTbkb7FKXx0rWH9oWdQ==","signatures":[{"sig":"MEUCIQC6pixJEhWA6xZrVoxbamO+ffIWOdU5IhzjMzOojNqangIgNI1eMMYkuCxIhNKwpIdpA/F6pyTWRYefc5MS4dbacrY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31342},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","gitHead":"839edbb9bd79ca1a9c308340a34a080fe463567b","scripts":{"dev":"tsc --watch","build":"tsc","publish":"npm publish --access public","prebuild":"rm -rf dist","prepublishOnly":"pnpm build"},"_npmUser":{"name":"gezilinll","email":"linbinghe@gmail.com"},"repository":{"url":"git+https://github.com/gezilinll/pica-gpu.git","type":"git"},"_npmVersion":"10.2.4","directories":{},"_nodeVersion":"20.11.1","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.2.2"},"_npmOperationalInternal":{"tmp":"tmp/pica-gpu_0.0.2_1741081799079_0.03931512779419721","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"pica-gpu","version":"0.0.3","keywords":["image","resize","webgl","gpu","canvas","typescript"],"author":{"name":"gezilinll"},"license":"MIT","_id":"pica-gpu@0.0.3","maintainers":[{"name":"gezilinll","email":"linbinghe@gmail.com"}],"homepage":"https://github.com/gezilinll/pica-gpu#readme","bugs":{"url":"https://github.com/gezilinll/pica-gpu/issues"},"dist":{"shasum":"7b9b552a5d4e180df21201a67c39a3984a92a28b","tarball":"https://registry.npmjs.org/pica-gpu/-/pica-gpu-0.0.3.tgz","fileCount":19,"integrity":"sha512-LpuYT3wV3Hzgdx3BHWNsnN5k1cMlA+sM1CUXiwyT4oQPAoQkOSRTAxZ2iCNA9QM+PXileLkcXZuL37UJ1AFt7A==","signatures":[{"sig":"MEQCIBYGC9jJ0migAptQ+FFuqX52dtT4JRgwWsjnrrYjXQf5AiAIBqEaS0w6EzxQIgMzYZHkZZtUluZo0x7GkuTQoV07pQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":33124},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","gitHead":"4b88abf7149e1202a5f07c1ff48e2042548f9695","scripts":{"dev":"tsc --watch","build":"tsc","publish":"npm publish --access public","prebuild":"rm -rf dist","prepublishOnly":"cp ../README.md . && cp ../LICENSE . && pnpm build"},"_npmUser":{"name":"gezilinll","email":"linbinghe@gmail.com"},"repository":{"url":"git+https://github.com/gezilinll/pica-gpu.git","type":"git"},"_npmVersion":"10.2.4","description":"**GPU accelerated image resizer**","directories":{},"_nodeVersion":"20.11.1","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.2.2"},"_npmOperationalInternal":{"tmp":"tmp/pica-gpu_0.0.3_1741082429887_0.8900214746814674","host":"s3://npm-registry-packages-npm-production"}},"0.0.4-s":{"name":"pica-gpu","version":"0.0.4-s","keywords":["image","resize","webgl","gpu","canvas","typescript"],"author":{"name":"gezilinll"},"license":"MIT","_id":"pica-gpu@0.0.4-s","maintainers":[{"name":"gezilinll","email":"linbinghe@gmail.com"}],"homepage":"https://github.com/gezilinll/pica-gpu#readme","bugs":{"url":"https://github.com/gezilinll/pica-gpu/issues"},"dist":{"shasum":"12e6e0723f3d579df8fd00db78b675d61693c766","tarball":"https://registry.npmjs.org/pica-gpu/-/pica-gpu-0.0.4-s.tgz","fileCount":11,"integrity":"sha512-TmUIahcOrVfV2bESICGxnZZXugA+CAM3w3ySZzRMMkSOK/qZ0XOH9wYD3NtP2ts0NX4gpKgG/LVSLAMkncT4Ww==","signatures":[{"sig":"MEYCIQCUjJiIOa8865GBpq3d0/X0TkmBnu4u/zRBISXE4G7JrwIhANvEr3JeWWIHHkcrU8+pWklrc4pT7pesXCigUUk4Quj4","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16405},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","gitHead":"c024162530290ca22dcd7e40fafa425b10bc6881","scripts":{"dev":"tsc --watch","build":"tsc","publish":"npm publish --access public","prebuild":"rm -rf dist","prepublishOnly":"cp ../README.md . && cp ../LICENSE . && pnpm build"},"_npmUser":{"name":"gezilinll","email":"linbinghe@gmail.com"},"repository":{"url":"git+https://github.com/gezilinll/pica-gpu.git","type":"git"},"_npmVersion":"10.2.4","description":"**GPU accelerated image resizer**","directories":{},"_nodeVersion":"20.11.1","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.2.2"},"_npmOperationalInternal":{"tmp":"tmp/pica-gpu_0.0.4-s_1741084004897_0.5110149120163314","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"pica-gpu","version":"0.1.0","keywords":["image","resize","webgl","gpu","canvas","typescript"],"author":{"name":"gezilinll"},"license":"MIT","_id":"pica-gpu@0.1.0","maintainers":[{"name":"gezilinll","email":"linbinghe@gmail.com"}],"homepage":"https://github.com/gezilinll/pica-gpu#readme","bugs":{"url":"https://github.com/gezilinll/pica-gpu/issues"},"dist":{"shasum":"8b13e7f4f18f7facc3ca3f54d02120ab6b0802fe","tarball":"https://registry.npmjs.org/pica-gpu/-/pica-gpu-0.1.0.tgz","fileCount":11,"integrity":"sha512-gcOQxNGCvOv9i47/nW9bzje36pmSr6Kuipoz0p34rgLiqVsDfKXQNWwB1sW3NOape1YBS8X17HohWMrGqyXDcg==","signatures":[{"sig":"MEQCIDo5X12PeDcMynpZ5bQIHA4X38O79YYJ+z7Z+rsjg7Y+AiACqQdc71x18A0FFt0ZWHIhS5jvU0Dgy0Jnfd2gDoZqHQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16579},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","gitHead":"258edc455bbf3fff5d5706881da3a1bfd8e598a5","scripts":{"dev":"tsc --watch","build":"tsc","publish":"npm publish --access public","prebuild":"rm -rf dist","prepublishOnly":"cp ../README.md . && cp ../LICENSE . && pnpm build"},"_npmUser":{"name":"gezilinll","email":"linbinghe@gmail.com"},"repository":{"url":"git+https://github.com/gezilinll/pica-gpu.git","type":"git"},"_npmVersion":"10.2.4","description":"**GPU accelerated image resizer**","directories":{},"_nodeVersion":"20.11.1","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.2.2"},"_npmOperationalInternal":{"tmp":"tmp/pica-gpu_0.1.0_1741139318795_0.8102381993059715","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"pica-gpu","version":"0.2.0","type":"module","main":"dist/index.js","module":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","dev":"tsc --watch","prebuild":"rm -rf dist","prepublishOnly":"cp ../README.md . && cp ../LICENSE . && pnpm build","publish":"npm publish --access public"},"keywords":["image","resize","webgl","gpu","canvas","typescript"],"author":{"name":"gezilinll"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/gezilinll/pica-gpu.git"},"bugs":{"url":"https://github.com/gezilinll/pica-gpu/issues"},"homepage":"https://github.com/gezilinll/pica-gpu#readme","devDependencies":{"typescript":"^5.2.2"},"_id":"pica-gpu@0.2.0","gitHead":"0fc76f7fba93ac7c20fb57d697754a7a8cfe137c","description":"**GPU accelerated image resizer**","_nodeVersion":"20.11.1","_npmVersion":"10.2.4","dist":{"integrity":"sha512-vu8rWPXQ1cYiDUv98mjgtgi1S0Wivxd6P7ySp2D6wHyTGhCGcskt6H0i36Q0/UGBAQYa4bF2O6El9Yt9U3wr/w==","shasum":"7574e71add9e35cede95c13a2a5684fdbd298fdc","tarball":"https://registry.npmjs.org/pica-gpu/-/pica-gpu-0.2.0.tgz","fileCount":11,"unpackedSize":16687,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBZdGuZD5ji87pCD1o3vk8GOPCSUxiazo1Wp115EVhe6AiAFjhPc7yUBS5WHncZ1VKoMa03svPXJ7MQEaCVxFVBh0A=="}]},"_npmUser":{"name":"gezilinll","email":"linbinghe@gmail.com"},"directories":{},"maintainers":[{"name":"gezilinll","email":"linbinghe@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pica-gpu_0.2.0_1741139624051_0.8764950891834158"},"_hasShrinkwrap":false}},"time":{"created":"2025-03-04T09:26:33.239Z","modified":"2025-03-05T01:53:44.405Z","0.0.1":"2025-03-04T09:26:33.513Z","0.0.2":"2025-03-04T09:49:59.317Z","0.0.3":"2025-03-04T10:00:30.146Z","0.0.4-s":"2025-03-04T10:26:45.069Z","0.1.0":"2025-03-05T01:48:38.979Z","0.2.0":"2025-03-05T01:53:44.235Z"},"bugs":{"url":"https://github.com/gezilinll/pica-gpu/issues"},"author":{"name":"gezilinll"},"license":"MIT","homepage":"https://github.com/gezilinll/pica-gpu#readme","keywords":["image","resize","webgl","gpu","canvas","typescript"],"repository":{"type":"git","url":"git+https://github.com/gezilinll/pica-gpu.git"},"description":"**GPU accelerated image resizer**","maintainers":[{"name":"gezilinll","email":"linbinghe@gmail.com"}],"readme":"# pica-gpu\n\n**GPU accelerated image resizer**\n\n[![npm version](https://img.shields.io/npm/v/pica-gpu.svg)](https://www.npmjs.com/package/pica-gpu)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n\n[demo](https://pica-gpu.gezilinll.com/)\n\n---\n\n## Overview\n\nPica-gpu is a high-quality, **GPU-accelerated** image resizer inspired by [Pica](https://github.com/nodeca/pica). While Pica’s original implementation runs on the CPU using JavaScript, pica-gpu leverages **WebGL** to offload filtering and convolution tasks to the GPU. This results in dramatically reduced CPU load and memory usage with a performance improvement of **2-10x** – especially noticeable when processing large images.\n\nPica-gpu implements a full set of filtering algorithms (including mks2013 and others) on the GPU already.\n\n---\n\n## Features\n\n- **GPU-accelerated image scaling**  \n  Offloads per-pixel filtering operations to the GPU via WebGL.\n\n- **High quality filters**  \n  Supports advanced filters (e.g. mks2013) with excellent anti-moiré and sharpening effects.\n\n- **Improved performance**  \n  Achieves 2-10× speedup over CPU-based Pica, with higher gains on larger images.\n\n- **Reduced CPU and memory usage**  \n  Avoids creating extra buffers by performing operations on the GPU.\n\n- **Simpler implementation**  \n  Unlike Pica, pica-gpu does not need to handle complexities such as web workers; it only requires WebGL support.\n\n- **Simple API**  \n  Designed to be a drop-in alternative to Pica with a similar API surface.\n\n## Installation\n\nYou can install pica-gpu via npm:\n\n```bash\nnpm install pica-gpu\n```\n\n## Usage\n\n```\nimport { resize } from 'pica-gpu'\n\nresize(from, to,\n{\n    filter,\n    targetWidth,\n    targetHeight,\n})\n```\n\n## API\n\n### .resize(from, to, options) -> void\n\nResize image from one canvas (or image) to another. Sizes are\ntaken from source and destination objects.\n\n- **from** - source, can be `HTMLCanvasElement`, `HTMLImageElement`, `ImageBitmap` `ImageData`, `OffscreenCanvas`.\n- **to** - destination canvas, its size is supposed to be non-zero.\n- **options** - quality (number) or object:\n  - **filter** - filter name (Default - `mks2013`). See [resize_filter_info.js](https://github.com/gezilinll/pica-gpu/blob/master/lib/src/shaders.ts) for details. `mks2013` does both resize and sharpening, it's optimal and not recommended to change.\n- **throw** When an error occurs, an exception containing the corresponding information will be thrown.\n\n**(!)** Because the target canvas must use a WebGL context, no other context type should be requested on it in advance. Otherwise, an error may occur, preventing the resize from working properly.\n","readmeFilename":"README.md"}