Command line interface for the smartcrop library to provide content aware image cropping.
JavaScript Shell
Switch branches/tags
Nothing to show
Clone or download
Latest commit 62f3e3b Feb 12, 2018
Failed to load latest commit information.
.dockerignore 2.0.2 Feb 12, 2018
.eslintrc.js 2.0.2 Feb 12, 2018
.gitignore Added .npmignore Jun 25, 2016
.npmignore Added .npmignore Jun 25, 2016
.travis.yml 2.0.2 Feb 12, 2018
Dockerfile 2.0.2 Feb 12, 2018
LICENSE Create LICENSE Feb 12, 2018 2.0.2 Feb 12, 2018
cat.jpg 2.0.2 Feb 12, 2018
package-lock.json 2.0.2 Feb 12, 2018
package.json bump version Feb 12, 2018
smartcrop-cli.js 2.0.2 Feb 12, 2018 2.0.2 Feb 12, 2018

Command line interface for smartcrop.js

Build Status

Example Image: by N. Feans

You can learn more about smartcrop.js on the library homepage

If the optional dependency node-opencv is installed smartcrop-cli can additionally detect faces and take them into account when finding the optimal crop.


You can install smartcrop-cli using npm:

npm install -g smartcrop-cli


Smartcrop-cli requires image magick to operate. On Debian based systems apt-get install imagemagick on mac os brew install imagemagick.


Usage: smartcrop [OPTION] FILE [OUTPUT]

  smartcrop --width 100 --height 100 photo.jpg square-thumbnail.jpg    generate a 100x100 thumbnail from photo.jpg

  --config         path to a config.json
  --width          width of the crop
  --height         height of the crop
  --faceDetection  perform faceDetection using opencv
  --outputFormat   image magick output format string     [default: "jpg"]
  --quality        jpeg quality of the output image      [default: 90]
  -*               forwarded as options to smartcrop.js