๐ŸŒ„ Image Resolution Adjust

ImageResolutionAdjust

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.

Pack: ControlFlowUtils

custom_nodes.ControlFlowUtils

Inputs (6)

NameTypeRequired
source_widthINTrequired
source_heightINTrequired
scaling_factorFLOATrequired
target_widthINTrequired
target_heightINTrequired
toleranceINTrequired

Outputs (3)

NameType
Adj. WidthINT
Adj. HeightINT
ResultSTRING