gm v1.9.0
GraphicsMagick for node.js
var gm = require('gm');
gm('/path/to/image.jpg')
.resize(353, 257)
.autoOrient()
.write(writeStream, function (err) {
if (!err) console.log(' hooray! ');
});
Get it!
First install either GraphicsMagick or ImageMagick. Then:
> npm install gm
var gm = require('gm')
, resizeX = 343
, resizeY = 257
gm('/path/to/image.jpg')
.blur(30, 20)
.resize(resizeX, resizeY)
.autoOrient();
.write(response, function (err) {
if (err) ...
});
var gm = require('gm')
, resizeX = 343
, resizeY = 257
gm('/path/to/image.jpg')
.implode(-1.2)
.resize(resizeX, resizeY)
.autoOrient();
.write(response, function (err) {
if (err) ...
});
var gm = require('gm')
, resizeX = 343
, resizeY = 257
gm('/path/to/image.jpg')
.contrast(-6)
.resize(resizeX, resizeY)
.autoOrient();
.write(response, function (err) {
if (err) ...
});
var gm = require('gm')
, resizeX = 343
, resizeY = 257
gm('/path/to/image.jpg')
.colorize(200, 200, 256)
.resize(resizeX, resizeY)
.autoOrient();
.write(response, function (err) {
if (err) ...
});
var gm = require('gm')
, resizeX = 343
, resizeY = 257
gm('/path/to/image.jpg')
.equalize()
.resize(resizeX, resizeY)
.autoOrient();
.write(response, function (err) {
if (err) ...
});
var gm = require('gm')
, resizeX = 343
, resizeY = 257
gm('/path/to/image.jpg')
.sepia()
.resize(resizeX, resizeY)
.autoOrient();
.write(response, function (err) {
if (err) ...
});
var gm = require('gm')
, resizeX = 343
, resizeY = 257
gm('/path/to/image.jpg')
.resize(resizeX, resizeY)
.region(101, 112, 90, 87)
.swirl(200)
.autoOrient();
.write(response, function (err) {
if (err) ...
});
var gm = require('gm')
, resizeX = 343
, resizeY = 257
gm('/path/to/image.jpg')
.rotate('green', -25)
.resize(resizeX, resizeY)
.autoOrient();
.write(response, function (err) {
if (err) ...
});
var gm = require('gm')
, resizeX = 343
, resizeY = 257
gm('/path/to/image.jpg')
.flip()
.rotate('green', -25)
.edge(3)
.resize(resizeX, resizeY)
.write(response, function (err) {
if (err) ...
});
var gm = require('gm')
, resizeX = 343
, resizeY = 257
gm('/path/to/image.jpg')
.rotate('green', -25)
.edge(3)
.resize(resizeX, resizeY)
.write(response, function (err) {
if (err) ...
});