Canvas
This operation is used to change image size without scaling. Image size can be reduced by cropping its edges according to the selected algorithm, or increased by adding a border of the specified color. The operation settings are adjusted with the help of the following parameters.
- width - Canvas width (default - 0)
- height - Canvas height (default - 0)
- relative - Canvas relative size option (default - no)
- anchor - Canvas anchor option (default - center)
- color - Canvas border color (default - transparent)
width
Width parameter specifies resulting image width, or width of the added border (in pixels) regarding the value of relative size option parameter. Its allowed values are whole positive numbers from 1 to 20000.
The default value is: 0.
Example:
height
Height parameter specifies resulting image height, or height of the added border (in pixels) regarding the value of relative size option parameter. Its allowed values are whole positive numbers from 1 to 20000.
The default value is: 0.
Example:
relative
Relative parameter specifies operation mode. Its allowed values are:
- yes - in this mode, canvas width and canvas height parameter values contain border size. Source image size remains the same and a border of specified width and height is added to it
- no - in this mode, canvas width and canvas height parameter values contain resulting image size. When performing this operation, all larger images are cropped while smaller ones are provided with a border.
The default value is: no.
Example:
anchor
Anchor parameter specifies sides of image cropping/bordering. Its allowed values are:
- �enter - cropping/bordering is performed regarding the center of the image.
- bottom - cropping/bordering is performed regarding the center of the image bottom edge.
- bottom_left - cropping/bordering is performed regarding the image bottom left angle.
- left - cropping/bordering is performed regarding the center of the image left edge.
- top_left - cropping/bordering is performed regarding the image top left angle.
- top - cropping/bordering is performed regarding the center of the image top edge.
- top_right - cropping/bordering is performed regarding the image top right angle.
- right - cropping/bordering is performed regarding the center of the image right edge.
- bottom_right - cropping/bordering is performed regarding the image bottom right angle.
The default value is: center.
Example:
color
Color parameter specifies border color. The color is specified in RGBA 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:
general example
ICPCL.exe -convertto bmp -source "C:\Original files" -dest "C:\Converted files" -oper Canvas width:100 height:200 relative:yes anchor:bottom_left color:"r:0,g:0,b:0,a:0"
tips
- If relative parameter is set to yes, resulting image size can be either increased or reduced (to create images of uniform size). In other case, resulting image size can only be increased (used to provide images with borders).