random-image-generator

1.0.2 • Public • Published

Random Image Generator

travis-ci.org

An npm module for generating random images. Intended for use in automated tests that require unique images.

Currently only supports generating very noisy JPEGs.

Available as both a node module in code and a command line tool.

Example

Example Random Image

Usage

JavaScript

var randomImageGenerator = require('random-image-generator'),
    fs = require('fs');
 
/**
 * Takes a width and height parameter
 * Returns a Buffer containing a JPEG image
 */
randomImageGenerator(800, 600, function(err, image) {
    fs.writeFile('random-image.jpg', image, function(err) {
        // done, hopefully
    });
});

Command Line

npm install -g random-image-generator

random-image-generator 800 600 > random-image.jpg

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    14
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    14
  • 1.0.1
    1
  • 1.0.0
    0

Package Sidebar

Install

npm i random-image-generator

Weekly Downloads

6

Version

1.0.2

License

MIT

Last publish

Collaborators

  • davidpadbury