Overview
This node generates text-based images dynamically based on user-defined parameters such as image size, background color, text color, font family, font size, and the text content itself. It is useful in scenarios where you need to create custom images with text overlays for social media posts, placeholders, banners, or any automated graphic generation workflows.
For example, you could use this node to generate a branded image with your company name in a specific font and colors, sized exactly for your website's hero section, or create multiple images with different texts for marketing campaigns automatically.
Properties
Name | Meaning |
---|---|
Image Width | Width of the generated image in pixels (number). |
Image Height | Height of the generated image in pixels (number). |
Background color | Background color of the image, specified as a hex color code (e.g., #000000 for black). |
Text Color | Color of the text, specified as a hex color code (e.g., #ffffff for white). |
Font Family | Font style used for the text. Options include: Pacifico, Poppins, Quicksand, Bitter, Cairo, Comfortaa, Cookie, Dosis, Gotham, Lobster, Marhey, Qwigley, Satisfy, Ubuntu. |
Font Size | Size of the text font in pixels (number). |
Text | The actual string of text to be rendered onto the image. |
Image Format | Output image format. Options are PNG, JPG, or WEBP. |
Output
The node outputs a single item containing:
json
: An empty JSON object{}
.binary.data
: The generated image file encoded as binary data. The filename and MIME type correspond to the selected image format (e.g.,image.png
with MIME typeimage/png
).
This binary output can be used downstream in workflows for saving files, uploading to cloud storage, or sending via email.
Dependencies
- The node makes an HTTP GET request to an external service endpoint
/image/{width}x{height}/{backgroundColorHex}/{textColorHex}
with query parameters specifying font family, font size, text, and image type. - No explicit API keys or authentication credentials are required according to the source code.
- The node relies on an internal helper method to prepare the binary data from the response.
Troubleshooting
Common issues:
- Invalid color codes (not starting with
#
or invalid hex length) might cause the external service to fail or return unexpected results. - Unsupported font family values (typos or values not in the options list) may result in default font fallback or errors.
- Extremely large image dimensions or font sizes could lead to performance issues or failures from the external service.
- Network connectivity problems will prevent the image from being generated.
- Invalid color codes (not starting with
Error messages:
- Errors related to HTTP requests (timeouts, 4xx/5xx responses) indicate issues with the external image generation service or network.
- If the node throws errors about missing parameters, ensure all required properties are set correctly.
Links and References
- No direct external documentation links are provided in the source code.
- For font families, you may refer to Google Fonts or similar resources to understand font styles.
- General n8n documentation on handling binary data: https://docs.n8n.io/nodes/creating-nodes/binary-data/