https://github.com/devongovett/concat-frames
Concatenate a pixel-stream into an array of frames
https://github.com/devongovett/concat-frames
Last synced: over 1 year ago
JSON representation
Concatenate a pixel-stream into an array of frames
- Host: GitHub
- URL: https://github.com/devongovett/concat-frames
- Owner: devongovett
- Created: 2014-11-15T03:18:45.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-03-06T06:53:30.000Z (over 11 years ago)
- Last Synced: 2025-02-28T07:02:10.021Z (over 1 year ago)
- Language: JavaScript
- Size: 145 KB
- Stars: 11
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# concat-frames
Concatenates a pixel-stream into an array of frame objects. This is useful for testing purposes,
and cases where you want an entire image frame at once, rather than a stream.
## Installation
npm install concat-frames
## Example
The following example produces an array of frames from an animated GIF
using [gif-stream](https://github.com/devongovett/gif-stream).
```javascript
var concat = require('concat-frames');
var GIFDecoder = require('gif-stream/decoder');
fs.createReadStream('in.gif')
.pipe(new GIFDecoder)
.pipe(concat(function(frames) {
// frames is an array of frame objects.
// each one has a `pixels` property containing
// the raw RGB pixel data for that frame, as
// well as the width, height, etc.
}));
```
## License
MIT