You are currently browsing the archives for the picture tag.

Smart Cropper

Smart Cropper allows you to automatically crop PNG, JPEG and GIF images by targeting high contrast regions on the picture, using edge detection to do so. It allows multiple crops at the same time.

A little howto :

$ smartcropper [OPTIONS] <files>

To crop one file :

$ smartcropper foo.jpg

To crop multiple files :

$ smartcropper foo.? */bar.jpg

The option -o, --output= [mask] allows you to specify the mask used to generate the output files' names. A mask is a string which may contain the following tokens :

  • # : numbering of the cropped picture, starts at 0 (use ## to have two digits numbers, ex. 01)
  • %n : name of the original picture, without extension
  • %e : original picture's extension
  • %d : directory containing the original picture

For example, to crop all JPEG pictures which are in a sub directory of the current directory, and to export them with a name consisting of their original directory name and their number in a directory called "small", one would use :

$ smartcropper */*.jpg –output=small/%d_###.%e

The default value for the output mask is "%d/cropped_%n.%e".

One can specify the size of the output using the following option :

-s, –size= [width] x [height]

Downloaded : 78 times
File : smartcropper-0.3.tar.gz
Size: 82.7 ko

.