VisezTrance

  • September 7, 2010 9:30 PM

    Scale and center crop with ImageMagick one liner

    By Daniel
    A few days ago I needed an image magick command that scales and crops a picture on its center. I looked up the last project I used it and found the magical line (pun intended). I'll post it here as a future reference for my self and perhaps it will help others as well.

    convert myPhoto.jpg -resize 200x200^ -gravity Center -crop 200x200+0+0 +repage myThumb.png

    The "myPhoto.jpg" picture is being scaled down to 200 pixels - width or height (the one that has lowest size), then it's cropped on the center. "myThumb.png" is the name of the photo that's being created. 
  • Monthly Archives

    • October 2013 (2)
    • May 2012 (1)
    • October 2011 (1)
    • September 2011 (2)
    • March 2011 (3)
    • February 2011 (1)
    • January 2011 (1)
    • September 2010 (1)
    • August 2010 (1)
    • June 2010 (1)
    • April 2010 (1)
    • December 2009 (1)
    • October 2009 (1)
    • September 2009 (1)
    • August 2009 (1)
    • July 2009 (2)
    • April 2009 (2)
    • February 2009 (1)
    • January 2009 (2)
    • December 2008 (1)
    • October 2008 (1)
  • Pages

    • About / Contact

2008, © Daniel Mircea