0CodeKit icon

0CodeKit

A toolbox of no-code utilities

Actions132

Image → Convert Image Format

AI-generated

Overview

The node provides image format conversion capabilities as part of a broader utility toolkit. It allows users to convert images from one format to another, supporting both input via a publicly accessible URL or directly from base64-encoded image data (buffer). This is useful in scenarios where images need to be standardized to a specific format for compatibility, optimization, or further processing.

Practical examples include:

  • Converting user-uploaded images to JPEG for web display.
  • Transforming PNG logos into WebP format to reduce file size.
  • Changing TIFF scans into PNG for easier sharing and viewing.
  • Preserving metadata when converting professional photography images.

Properties

Name Meaning
Data Type Choose the source type of the image data: either a publicly accessible URL or a base64 buffer.
Image URL The URL of the image to convert (required if Data Type is URL). Must be publicly accessible.
Image Buffer Base64-encoded image data to convert (required if Data Type is Buffer).
Target Format The desired output image format. Options: BMP, GIF, JPEG, PNG, TIFF, WebP.
Include Metadata Whether to preserve the original image's metadata in the converted output (true/false).
Conversion Options Additional JSON-formatted options for conversion, e.g., quality settings for JPEG format.

Output

The node outputs the converted image data in JSON format. The exact structure is not detailed in the provided code, but typically it would include at least:

  • The converted image data, likely as a base64-encoded string or a URL to the converted image.
  • Possibly metadata about the conversion process or the resulting image.

If binary data is output, it represents the converted image file in the chosen format.

Dependencies

  • Requires an API key credential for authentication with the external 0CodeKit service.
  • The node sends a POST request to the /image/convert endpoint of the 0CodeKit API (https://prod.0codekit.com/image/convert).
  • The API expects parameters including the data type, image source (URL or buffer), target format, metadata inclusion flag, and conversion options.

Troubleshooting

  • Common issues:

    • Providing a non-publicly accessible URL will cause the conversion to fail because the service cannot fetch the image.
    • Incorrectly formatted base64 image data may result in errors or failed conversions.
    • Unsupported or misspelled target formats can cause the API to reject the request.
    • Invalid JSON in the "Conversion Options" property can lead to parsing errors.
  • Error messages and resolutions:

    • "Image not found or inaccessible": Verify that the URL is correct and publicly accessible.
    • "Invalid image data": Check that the base64 string is properly encoded and complete.
    • "Unsupported format": Ensure the target format is one of the supported options (BMP, GIF, JPEG, PNG, TIFF, WebP).
    • "Malformed JSON in options": Validate the JSON syntax in the Conversion Options field.

Links and References

Discussion