# pap

> Blurs images and renders them to a canvas element

Latest version **0.6.3** (published 2022-02-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install pap
pnpm add pap
yarn add pap
bun add pap
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.6.3 |
| Published | 2022-02-25 |
| First published | 2014-11-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 18 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | George Michael Faust |
| Maintainers | turbobeast |
| Keywords | imageData, blur, glsl, webgl, canvas |

## Links

- npm: https://www.npmjs.com/package/pap
- Repository: https://github.com/turbobeast/pap
- Homepage: https://github.com/turbobeast/pap#readme
- Issues: https://github.com/turbobeast/pap/issues
- npm.io page: https://npm.io/package/pap

## Dependencies (2)

- [glslify](https://npm.io/package/glslify.md) ^2.1.2
- [webworkify](https://npm.io/package/webworkify.md) ^1.1.0

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 0.6.3 (latest) — 2022-02-25
- 0.6.2 — 2016-05-16
- 0.6.1 — 2016-05-13
- 0.6.0 — 2016-05-10
- 0.5.1 — 2016-05-06
- 0.4.1 — 2015-06-13
- 0.4.0 — 2015-06-12
- 0.3.0 — 2015-02-20
- 0.2.0 — 2014-11-23
- 0.0.1 — 2014-11-22

## README

## Pap

[![NPM](https://nodei.co/npm/pap.png)](https://www.npmjs.org/package/pap)

Renders blurred versions of images to canvas.

Import the module.

```javascript
const pap = require('pap')();
```

Load an image and draw it on a canvas.

```javascript
const imageElement = document.createElement('image');

imageElement.addEventListener("load", function () {
    pap.initialize(imageElement);
    pap.blur(64);
    document.body.appendChild(pap.canvas);
});

imageElement.src = "images/kittens.jpg";
```

Initialize once, and update blur live.


```javascript
const Pap = require('pap');
const mage = document.createElement('img');

mage.onload = function () {
    var pap = Pap();
    pap.initialize(mage);
    document.body.appendChild(pap.canvas);
    var inc = 0;
    var blurWave = function () {
        inc += 0.02;
        pap.blur(Math.sin(inc) * 32 + 32);
        requestAnimationFrame(blurWave);
    };

    blurWave();
};

mage.src = "images/kittens.jpg";
```

---
_Source: https://npm.io/package/pap · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
