Create thumbnails from images, videos and web pages.
npm install thumbbot --save
- PhantomJS - web page snapshots
- ImageMagick - image thumbnails
- ffmpeg - video snapshots
var Thumbbot = require('thumbbot');
var image = new Thumbbot('image.png');
image.resize(200, 200); // width, height
// or
image.width(200);
.height(200);
var thumbnail = yield image.save();
var image = new Thumbbot('image.png');
image.crop(0, 0, 200, 200); // x, y, width, height
var thumbnail = yield image.save();
var video = new Thumbbot('video.mp4');
video.seek('00:01:24'); // take a snapshot at 01:24
var thumbnail = yield video.save();
var page = new Thumbbot('http://smashingmagazine.com');
page.window(1024, 768) // specify browser window size, optional
.crop(100, 100, 400, 400) // specify an area to capture, x, y, width & height, optional
.disable('javascript') // disable javascript, optional
.disable('images'); // disable loading images, optional
var thumbnail = yield page.save();
To run tests execute:
npm test
Thumbbot is released under the MIT License.