Scale Image
Verb: scaleImage
Available from: <Standard>
Scales an image by multiplying its height and width by a specific numeric value.
Syntax
scaleImage --image(Image) --scalefactor(Numeric) (Image)=value
Inputs
Script | Designer | Required | AcceptedTypes | Description |
---|---|---|---|---|
--image | Image | Required | Image | Variable with the image that should be scaled. |
--scalefactor | Scale | Required | Number | Scale value used to multiply the height and width dimensions of the Image.
Negative numbers are not accepted. Therefore, to decrease the height and width dimension of an image, simply enter a value between 0 and 1, for instance: 0.1 or 0.11. To increase height and width, enter a value greater than 1, such as 1.5 or 2.4. |
Outputs
Script | Designer | AcceptedTypes | Description |
---|---|---|---|
value | Resized Image | Image | Returns the image scaled. |
Example
After loading the image from the Upload Image command, the Scale Image command will resize its height and width to the specified scale, which in this context will be "10". After this operation, using the Get System Folder Path and Save Image commands, the scaled image is saved in the "My Documents" directory for analysis.
defVar --name scaledImage --type Image
defVar --name documensPath --type String
defVar --name scaledImagePath --type String
defVar --name image --type Image
// Download the following file to execute the command.
loadImage --file "wdg.PNG" image=value
// Resizes the image using a scale of "10".
scaleImage --image ${image} --scalefactor 10 scaledImage=value
// Get the path of the "My Documents" folder to save the scaled image.
getSpecialFolder --folder "MyDocuments" documensPath=value
saveImage --image ${scaledImage} --directory "${documensPath}" --file scaledImage --format "Jpeg" scaledImagePath=value
To view the change made by the command, go to the properties of the resized image saved in "My Documents" with the name "scaledImage". Then its width and height can be compared with the original image.