Batch command line image crop
Image Converter Plus
Image Converter Plus Home FeaturesDownloadOrderSupport

Introduction of ImageConverter Plus command line
Program Overview
Program Features
Comand line syntax
Script
Makebat
Source
Convertto
BMP
JPG
GIF
PNG
TGA
TIFF
PSD
EXR
DDS
PDF
EPS
MNG
Dest
Save_opt
Template
Target_opt
Add operations (-oper)
Crop
Effect
Mirror
Resize
Rotate
Replace_color
Canvas
Color_profile
Watermark
Page_filter
Sort
How to...
Launching the program
Launch the program?
Launch the program from BATCH-file?
Launch the program from another application?
Use ImageConverter Plus command line on Web-server?
Launch the program from PERL script under Windows server?
Launch the program from Cold Fusion?
Launch the program from ASP?
Hide concole window when I launch the program from my application?
Working with files and folders
Convert files from local network?
Convert files from folder with all subfolders?
Specify name of output file?
Delete source images after conversion?
Overwrite files?
Convert CALS Raster files to TIFF?
Convert DICOM image file into TIFF?
Convert PCX file into TIFF?
Convert PDF file into TIFF in batch mode?
Convert SFF files into TIFF?
Convert TIFF file with Wang OldJPEG compression into standard TIFF?
Convert WinFax files into TIFF?
Convert WPG clipart into TIFF?
Convert color image into grayscale TIFF?
Convert Group3 and Group4 Fax files into TIFF format?
Changing image size and resolution
Stretch image proportionally?
Change image resolution?
Change image size and keep resolution?
Working with border and margins
Crop white margins from photo and fax?
Add a solid border to all images?
Working with colors and transparency
Change one color to another?
Invert colors?
Convert file with CMYK color space?
Make colors transparent?
Other questions
Save each page of multipage file separately?
Find out what version of batch converter you have?
Convert TIFF file with rotation?
Create a multipage file?
Find out numeric color code?
Additional Information
Color effects
Features in details
Supported formats
Registration and licensing
License agreement
Order ImageConverter Plus
fCoder On-line
About
Online support form
Custom development

Batch command line image crop

Crop

This operation crops image borders and leaves the selected part of the image. Image size is reduced without changing image resolution, so that images are not distorted. Settings of this poeration are adjusted with the help of the following parameters:

  • method - crop method (default - margins)
  • size - crop sizes (default - 0 0 0 0)
  • color - color sample for autocrop (default - "r:255,g:255,b:255,a:255")
  • tolerance - tolerance value for autocrop (default - 0)

method

Method parameter specifies the mode of Crop image operation. This parameter specifies whether other parameters should be set. Its allowed values are:

  • margins - this parameter specifies that the number of pixels set in size parameter shoud be cropped from every side of the image.

Example:

-oper Crop method:margins

  • rect_2p - this mode lets specify a rectangle. The program will crop all image parts not included into this rectangle. The rectangle is set with the help of size parameter with coordinates of the top left and bottom right corners.

Example:

-oper Crop method:rect_2p

  • rect_pwh - this mode lets specify a rectangle. The program will crop all image parts not included into this rectangle. The rectangle is set with the help of size parameter with coordinates of the top left corner, width and height.

Example:

-oper Crop method:rect_pwh

  • autocrop - this mode lets remove monochromatic edges from images of various size. The area to be cropped is detected auromatically for every image by color of its margins. Use color and tolerance parameters to adjust crop settings for this mode.

The default value is: margins.

Example:

-oper Crop method:autocrop

size

Size parameter value depends on method parameter value.

size:<X1 X2 X3 X4>

Where X1, X2, X3, X4 are whole positive numbers including 0.

  • method:margins - crop sizes parameter specifies the width of the margin (in pixels) cropped from each side of the image: left top right bottom.

Example:

-oper Crop size:100 50 100 50

  • method:rect_2p - crop sizes parameter specifies the coordinates of the top left and bottom right corners of the rectangle: left top right bottom.

Example:

-oper Crop size:0 0 400 300

  • method:rect_2p - crop sizes parameter specifies the coordinates of the top left corner of the rectangle, its width and height: left top width heigth.

Example:

-oper Crop size:0 0 300 200

The default value is: 0 0 0 0.

color

Color parameter specifies the color of the margins to be cropped in autocrop mode. The color is specified in RGB mode.

color:"r:X1,g:X2,b:X3,a:X4"

Where X1, X2, X3, X4 are whole positive numbers from 0 to 255.

The default value is: "r:255,g:255,b:255,a:255" (transparent).

Example:

-oper Crop color:"r:255,g:255,b:255,a:100"

tolerance

Tolerance parameter specifies the allowed deviation from the color specified in color parameter. Its values are whole numbers from 0 to 100.

The default value is: 0.

Example:

-oper Crop tolerance:5

ICPCL.exe -convertto bmp -source "C:\Original files" -dest "C:\Converted files" -oper Crop method:margins size:100 50 100 50

ICPCL.exe -convertto bmp -source "C:\Original files" -dest "C:\Converted files" -oper Crop method:rect_2p size:0 0 400 300

ICPCL.exe -convertto bmp -source "C:\Original files" -dest "C:\Converted files" -oper Crop method:rect_pwh size:0 0 300 200

ICPCL.exe -convertto bmp -source "C:\Original files" -dest "C:\Converted files" -oper Crop method:autocrop color:"r:255,g:255,b:255,a:100" tolerance:5

tips

  1. Crop sizes parameter should be used only if method parameter has margins, rect_2p or rect_pwh values.
  2. Example:

    ICPCL.exe -convertto bmp -source "C:\Original files" -dest "C:\Converted files" -oper Crop method:margins size:100 50 100 50

  3. Color sample for autocrop and tolerance sample for autocrop parameters should be used only if method parameter has autocrop value.
  4. Example:

    ICPCL.exe -convertto bmp -source "C:\Original files" -dest "C:\Converted files" -oper Crop method:autocrop color:"r:255,g:255,b:255,a:100" tolerance:5

  5. When working in autocrop mode, be very precise in specifying edge color to achieve better results. Tolerance sample for autocrop parameter is used when image margins are not monochromatic.

© 2007, fCoder Group, Inc.
Site Map | Other Projects