# pixels-please

> An image loading module for graphics applications.

Latest version **1.0.3** (published 2018-09-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install pixels-please
pnpm add pixels-please
yarn add pixels-please
bun add pixels-please
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2018-09-03 |
| First published | 2018-07-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 621.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 0 |
| Author | Daniel Anderson |
| Maintainers | dananderson |
| Keywords | image, game, pixels, resize, png, jpg, jpeg, gif, tga, psd |

## Links

- npm: https://www.npmjs.com/package/pixels-please
- Repository: https://github.com/dananderson/pixels-please
- Homepage: https://github.com/dananderson/pixels-please#readme
- Issues: https://github.com/dananderson/pixels-please/issues
- npm.io page: https://npm.io/package/pixels-please

## Dependencies (3)

- [bindings](https://npm.io/package/bindings.md) ^1.3.0
- [node-addon-api](https://npm.io/package/node-addon-api.md) ^1.2.0
- [napi-thread-safe-callback](https://npm.io/package/napi-thread-safe-callback.md) ^0.0.5

## 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

- 1.0.3 (latest) — 2018-09-03
- 1.0.1 — 2018-07-24
- 1.0.0 — 2018-07-14

## README

# Pixels, Please

An image loading module for graphics applications.

* Supports many popular image formats.
* Image resizing.
* Pixel data conversion for 32-bit texture formats. 
* Non-blocking image loading and processing.

Tested on Windows, Mac and Linux (including Raspberry Pi).

# Requirements

* Pixels, Please contains native code and requires a system with a proper C++ toolchain (node-gyp).

# Install

```
npm install --save pixels-please
```

```
yarn add pixels-please
```

* Installation requires node-gyp.

# Examples

Asynchronously load image data into a Buffer.

```javascript
const Pipeline = require('pixels-please');

Pipeline(imageFilename)
    .bytes({format: 'argb'})
    .toBuffer()
    .then(buffer => {
        // ...
    });
```

Synchronously load image data into a Buffer in 32 bit ARGB format.

```javascript
const Pipeline = require('pixels-please');

let buffer = Pipeline(imageFilename)
    .bytes({format: 'argb'})
    .toBufferSync();
```

Read the image header for size information.

```javascript
const Pipeline = require('pixels-please');

let header = Pipeline(imageFilename)
    .toHeaderSync();

console.log(`${header.width}x${header.height}`);
```

Resize an image to fit into a 100x100 bounding box, preserving aspect ratio.

```javascript
const Pipeline = require('pixels-please');

let buffer = Pipeline(imageFilename)
    .bytes()
    .fit()
    .filter('gaussian')
    .resize(100, 100)
    .toBufferSync();
```

# Image Formats

| Extension | Limitations |
|---|---|
| .jpg | baseline & progressive (12 bpc/arithmetic not supported, same as stock IJG lib) |
| .png | 1/2/4/8 bits per channel |
| .tga | None |
| .bmp | non-RLE, non-1bpp |
| .psd | composited view only, no extra channels, 8 bit-per-channel |
| .gif | animated not supported |
| .hdr | radiance rgbE format |
| .pic | None |
| .ppm | binary only |
| .pgm | binary only |
| .svg | Supports a subset of SVG, including shapes, paths, etc. |

# License

Code is under the [MIT License](https://opensource.org/licenses/MIT).

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