Actions4
转换格式
AI-generatedOverview
This node processes images by converting their format using the sharp library. It supports input images provided as file paths, base64 strings, or binary data. Users can specify the output format (e.g., JPEG, PNG, WebP, AVIF, TIFF) and choose to save the processed image to a file or output it as binary data. Additional options include adding descriptive metadata to the image and adjusting output quality. This node is useful for workflows requiring image format conversion, such as preparing images for web use or standardizing image formats in a batch process.
Use Case Examples
- Convert a PNG image file to JPEG format and save it to a specified path.
- Convert a base64 encoded image to WebP format and output it as binary data for further processing.
- Convert an image from binary data input to TIFF format with added description metadata.
Properties
| Name | Meaning |
|---|---|
| 附加描述信息 | Add additional descriptive information to the image, similar to PNG comments or EXIF description. |
| Input Type | The type of input for the image, which can be a file path, base64 string, or binary data. |
| Source Path | The path of the source image file (required if input type is file path). |
| Base64 Image | The base64 encoded image data (required if input type is base64). |
| Binary Property | The binary property containing the image data (required if input type is binary data). |
| Target Path | The path where the processed image will be saved (required if output type is file). |
| Format | The format of the output image, such as JPEG, PNG, WebP, WebP lossless, AVIF, TIFF, or same as source file. |
| 输出类型 | Choose output method: save the processed image to a file or output as binary data. |
| Quality | The quality of the output image, ranging from 1 to 100. |
Output
JSON
error- Error message if processing fails.success- Boolean indicating if the operation was successful.operation- The image processing operation performed.
Dependencies
- sharp library for image processing
Troubleshooting
- Ensure the input image path or data is valid and accessible.
- Check that the output path is writable if saving to a file.
- Verify the specified output format is supported and correctly spelled.
- If processing fails, the node returns an error message in the output JSON; review this message for troubleshooting.