Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (pica-gpu) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
pica-gpu
GPU accelerated image resizer
Overview
Pica-gpu is a high-quality, GPU-accelerated image resizer inspired by 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.
Pica-gpu implements a full set of filtering algorithms (including mks2013 and others) on the GPU already.
Features
GPU-accelerated image scaling
Offloads per-pixel filtering operations to the GPU via WebGL.High quality filters
Supports advanced filters (e.g. mks2013) with excellent anti-moiré and sharpening effects.Improved performance
Achieves 2-10× speedup over CPU-based Pica, with higher gains on larger images.Reduced CPU and memory usage
Avoids creating extra buffers by performing operations on the GPU.Simpler implementation
Unlike Pica, pica-gpu does not need to handle complexities such as web workers; it only requires WebGL support.Simple API
Designed to be a drop-in alternative to Pica with a similar API surface.
Installation
You can install pica-gpu via npm:
npm install pica-gpu
Usage
import { resize } from 'pica-gpu'
resize(source, {
filter,
targetWidth,
targetHeight,
...
})