I am trying to get sketch effect and i have the imagemagick command line code as follows
convert 1.jpg -colorspace gray ( +clone -blur 0x8 \) +swap -compose divide -composite -linear-stretch 2%x20% cousincs.jpg
I am using gm module and I tried to extend gm,however it is not not accepting parenthesis, failing to recognize -linear-stretch resulting in two blurred images instead of one. I tried node-imagemagick native and wizardry but unable to achieve the desired functionality. Can anyone let me know how can I achieve this. Thanks in advance
Here is the code i tried with gm
var dir = __dirname + '/kar/';
var newName=uuid.v4()+".jpg";
imageMagick("2.jpg")
.clone()
.swap()
.compose('divide')
.composite()
.write(dir+newName, function(err,data){console.log("error is ",err)});
Here is the args.js
proto.clone = function clone () {
return this.out("\( +clone -blur 0x8\)");
}
proto.swap=function swap(){
return this.out("+swap");
}
proto.composite=function composite(){
return this.out("-composite -linear-stretch 2%x20%")
}