A node.js script to calculate the best corner to watermark a image
JavaScript
Latest commit f9676ff Mar 28, 2015 @rodrigoalviani Update README.md
Permalink
Failed to load latest commit information.
lib Move script to lib folder Dec 30, 2014
test Add more tests Feb 23, 2015
.gitignore Add gitignore Dec 29, 2014
LICENSE Add license Dec 29, 2014
README.md Update README.md Mar 27, 2015
app.js Fix help cmd Feb 13, 2015
package.json Add devDependencies Feb 18, 2015

README.md

watermark-best-corner

A node.js script to calculate the best corner to apply watermark in a image. The script uses the color similarity to determine the best corner to apply watermark. The script will return NorthEast, NorthWest, SouthEast or SouthWest. The return could be used as 'gravity' parameter of imagemagick.


Requirement

  • ImageMagick is 6.8.9+

How to use

Require lib

var corner = require('./lib/corner');

Send a image to corner function

request({
    url: encodeURI('http://www.website.com/image.jpg')
  })
  .on('response', function (img) {
    corner(img, function (c) {
      console.log(c);
    });
  });

Or try a command line

node app.js -u http://guiadossolteiros.com/wp-content/uploads/2013/08/mulher-lavando-carro-520x245.jpg