2.0.0 • Published 6 years ago

to-rgba-array v2.0.0

Weekly downloads
1
License
BSD-3-Clause
Repository
github
Last release
6 years ago

To-rgba-array Build Status NPM version

Convert a variety of formats to an rgba array.

Purpose

Basically used to make plugins etc input format agnostic. Give it a canvas, an image in a buffer, a buffer with RGBA pixels, and it'll ensure you have a Uint8ClampedArray out.

Usage

var toRGBAArray = require('to-rgba-array');
var assert = require('assert');

var canvas = new Canvas(200,200);
const result = toRGBAArray(canvas);
assert(result instanceof Uint8ClampedArray);

API

to-rgba-array

module.exports(frame) ⇒ Uint8ClampedArray

Convert an input image into a Uint8ClampedArray containing RGBA pixels.

Kind: Exported function Returns: Uint8ClampedArray - The RGBA pixels.

ParamTypeDescription
frameCanvas | BufferThe input image. Buffer can contain an image format (jpeg/png etc) or just RGBA pixels.

Note: To regenerate this section from the jsdoc run npm run docs and paste the output above.

2.1.0-raw.0

6 years ago

2.0.0

6 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago