This node receives a given image size Source_Width and Source_Height and performs calculations to automatically resize the image based either on a given Scaling_Factor or towards a specific Target_Width and Target_Height.
If the Scaling Factor is used the image's aspect ratio will be adjusted directly. If the value is > 1, the image's width will be multiplied by the Scaling_Factor. If the value is < 1 the image's height will be changed instead.
If either Target_Width and Target_Height (but not both) are specified, the image final size will be adjusted to be rescaled to the target, while still attempting to maintain the closest possible approximation to the original Aspect Ratio. The aggressiveness of this approximation is determined by the value of Tolerance, which will make sure the final sizes are always multiples of Tolerance. If Both are specified (such that they are the same to each other or identical to the Source values), the Adjusted Width and Height will be returned immediately, as no further calculation is required.
For the most part the default values work well, and you should specify either a Target_Width or Target_Height to obtain the desired effect, although Scaling_Factor can also be useful in certain situations.
HOVER OVER THE INPUTS AND OUTPUTS FOR MORE INFO.
By VykosXΒ·Created 2 years agoΒ·Updated 2 years agoΒ· 147
π Image Resolution Adjust
Adj. Width
Adj. Height
Result
βsource_width512βΊ
βsource_height512βΊ
βscaling_factor1.0βΊ
βtarget_width512βΊ
βtarget_height512βΊ
βtolerance32βΊ
CategoryπΊ VykosX-ControlFlowUtils
Inputs (6)
Name
Type
Default
Description
source_width
INT
51216β8192
The original width of the image to adjust
source_height
INT
51216β8192
The original height of the image to adjust
scaling_factor
FLOAT
1.00.1β10
The scaling factor to multiply the image's dimensions by. > 1 values affect image width and < 1 values affect image height
target_width
INT
51216β8192
The new target width of the image where the new height can be automatically extrapolated from
target_height
INT
51216β8192
The new target height of the image where the new width can be automatically extrapolated from
tolerance
INT
3216β1024
How many pixels at most the target width and height should be from each other. Greater values result in greater differences
Outputs (3)
Name
Type
Description
Adj. Width
INT
Adjusted width of the image after calculation
Adj. Height
INT
Adjust height of the image after calculation
Result
STRING
String expression that displays the performed calculation