A node.js script to calculate the best corner to watermark a image
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
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



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.


  • ImageMagick is 6.8.9+

##How to use

Require lib

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

Send a image to corner function

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

Or try a command line

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