🍒Icon_Position_Cropper / 图标位置裁剪:
The Icon_Position_Cropper node is designed to facilitate the precise cropping of images based on specified positional data. This node is particularly useful for AI artists who need to extract specific sections of an image, such as icons or other graphical elements, by defining the coordinates of the desired area. By leveraging this node, you can automate the process of isolating parts of an image, which is especially beneficial when dealing with large batches of images or when the cropping needs to be consistent across multiple images. The node uses positional data to determine the four corner points of the cropping area, ensuring that the extracted section is accurate and aligned with your specifications. This functionality is crucial for tasks that require high precision, such as preparing assets for UI design or creating datasets for machine learning models.
🍒Icon_Position_Cropper / 图标位置裁剪 Input Parameters:
图片
This parameter represents the image to be processed and must be provided as a torch.Tensor. The image serves as the source from which specific sections will be cropped based on the positional data. Ensuring the image is in the correct format is crucial for the node to function properly.
位置数据
The 位置数据 parameter contains the positional information necessary for determining the cropping area. This data should include details about the coordinates and dimensions of the sections to be cropped. It is essential for guiding the node in identifying the correct areas of the image to extract.
起始列号
This integer parameter specifies the starting column number for the cropping operation. It defines the horizontal boundary from which the cropping begins. The default value is 0, with a minimum of 0 and a maximum of 100, allowing you to adjust the starting point as needed.
终止列号
Similar to 起始列号, this integer parameter sets the ending column number, marking the horizontal boundary where the cropping ends. The default value is 8, with a range from 0 to 100, providing flexibility in defining the cropping area.
行号
The 行号 parameter determines the row number up to which the cropping should occur. It sets the vertical boundary for the cropping operation. With a default value of 8 and a range from 0 to 100, this parameter helps in fine-tuning the vertical extent of the cropped area.
🍒Icon_Position_Cropper / 图标位置裁剪 Output Parameters:
裁切后图像
The output parameter 裁切后图像 represents the cropped image resulting from the node's operation. This output is an image tensor that contains only the section of the original image defined by the input positional data. It is crucial for tasks that require isolated image sections, such as icon extraction or dataset preparation.
🍒Icon_Position_Cropper / 图标位置裁剪 Usage Tips:
- Ensure that the
位置数据is accurate and corresponds to the image dimensions to avoid incorrect cropping results. - Use the
起始列号,终止列号, and行号parameters to precisely define the cropping area, especially when dealing with images of varying sizes. - Verify that the input image is a
torch.Tensorto prevent errors during processing.
🍒Icon_Position_Cropper / 图标位置裁剪 Common Errors and Solutions:
"位置数据为空,无法进行裁切"
- Explanation: This error occurs when the positional data required for cropping is missing or not provided.
- Solution: Ensure that the
位置数据parameter is correctly populated with the necessary positional information before executing the node.
"图片必须是 torch.Tensor 类型"
- Explanation: This error indicates that the input image is not in the expected
torch.Tensorformat. - Solution: Convert the image to a
torch.Tensorformat before passing it to the node to ensure compatibility.
