Percentage Crop Calculator (CRT):
The CRTPctCropCalculator is a versatile node designed to crop images based on specified percentages of their width and height. This node allows you to precisely control the cropping process by defining how much of the image's dimensions should be retained, offering a straightforward method to focus on specific areas of an image. By providing the ability to crop from various locations such as the center, top, bottom, left, right, and corners, it enhances your creative workflow by simplifying the task of image manipulation. This node is particularly beneficial for artists and designers who need to adjust image compositions dynamically, ensuring that the desired portion of an image is highlighted or preserved.
Percentage Crop Calculator (CRT) Input Parameters:
image
This parameter represents the input image that you want to crop. It is the source material upon which the cropping operation will be performed.
crop_percent_width
This parameter specifies the percentage of the original image's width that should be retained after cropping. It accepts a floating-point value ranging from 0.0 to 100.0, with a default value of 10.0. A higher percentage retains more of the image's width, while a lower percentage results in a narrower cropped image.
crop_percent_height
Similar to the width parameter, this specifies the percentage of the original image's height to retain. It also accepts a floating-point value between 0.0 and 100.0, with a default of 10.0. Adjusting this value allows you to control the vertical extent of the cropped image.
location
This parameter determines the starting point of the crop within the image. It offers several options: "center", "top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", and "bottom-right", with "center" as the default. This choice affects which part of the image is preserved and which is discarded during cropping.
Percentage Crop Calculator (CRT) Output Parameters:
image
The output image is the result of the cropping operation, reflecting the specified width and height percentages and the chosen location. It is a modified version of the input image, tailored to your cropping specifications.
width
This output provides the new width of the cropped image, expressed as an integer. It indicates how many pixels wide the resulting image is after the cropping process.
height
This output gives the new height of the cropped image, also as an integer. It shows the number of pixels in the vertical dimension of the cropped image.
Percentage Crop Calculator (CRT) Usage Tips:
- To maintain the central focus of an image while reducing its size, use the "center" location with moderate crop percentages.
- For creative compositions, experiment with different location settings like "top-left" or "bottom-right" to achieve unique perspectives.
Percentage Crop Calculator (CRT) Common Errors and Solutions:
Image shape mismatch
- Explanation: This error occurs when the input image does not have the expected shape or dimensions, which can disrupt the cropping process.
- Solution: Ensure that the input image is correctly formatted and has the necessary dimensions before passing it to the node.
Invalid crop percentage
- Explanation: If the crop percentage values are set outside the allowed range (0.0 to 100.0), the node may not function as expected.
- Solution: Double-check the crop percentage values to ensure they fall within the valid range and adjust them accordingly.
