I'm using GraphicsMagick to modify the image. It is working fine on windows but when i try running it on ubuntu it gives me an error
Unrecognized virtual pixel method (transparent).
Below is the command i'm using
gm convert newImages/December31201542014pm3630/profileLarge.jpg -background transparent -rotate -2 -matte -virtual-pixel transparent -distort Perspective \"0,0 0,0 213,0 213,20 213,160 213,165 0,80 0,80 \" newImages/December31201542014pm3630/skew_profile.png
I got it working. I simply installed Imagemagick.