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:
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:
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:
general example
ICPCL.exe -convertto bmp -source "C:\Original files" -dest "C:\Converted files" -oper Crop method:margins size:100 50 100 50
general example
ICPCL.exe -convertto bmp -source "C:\Original files" -dest "C:\Converted files" -oper Crop method:rect_2p size:0 0 400 300
general example
ICPCL.exe -convertto bmp -source "C:\Original files" -dest "C:\Converted files" -oper Crop method:rect_pwh size:0 0 300 200
general 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
tips
- Crop sizes parameter should be used only if method parameter has margins, rect_2p or rect_pwh values.
Example:
ICPCL.exe -convertto bmp -source "C:\Original files" -dest "C:\Converted files" -oper Crop method:margins size:100 50 100 50 - Color sample for autocrop and tolerance sample for autocrop parameters should be used only if method parameter has autocrop value.
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 - 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.