Write PNG
Controlled node
Overview
The Write PNG node saves image data as a PNG file in the project library. It is useful when you need to export processed or generated images while preserving PNG output, including images that may require transparency.
Inputs
| Input | Type | Description | Default |
|---|---|---|---|
| Run | Event | Triggers the PNG creation and upload. | - |
| Data | Data | The image data to save. Supports a Jimp image object, base64 string, or Buffer. | - |
| Name | Data | The filename for the generated image. If the name does not end with .png, the extension is appended automatically. | - |
| Path | Data | Optional folder path in the library where the PNG should be saved. Missing folders are created automatically. If omitted, the file is saved in the root library folder. | root |
Outputs
| Output | Type | Description |
|---|---|---|
| Done | Event | Fires when the node has finished running. |
| File | Data | The generated library file reference. If image processing or upload fails, this output contains an error object. |
Runtime Behavior and Defaults
- Controlled Node: The node runs only when the Run event fires.
- Project Requirement: A runtime project ID is required so the PNG can be uploaded to the project library.
- Filename Handling: The node requires a non-empty Name input.
.pngis appended if the extension is missing. - Directory Creation: If Path is provided, the node creates or resolves that library folder path before uploading.
- Image Conversion: Jimp images are encoded as PNG. Base64 strings and Buffers are uploaded as image buffers.
- Error Handling: If data, project ID, filename, image processing, or upload fails, File contains an error object instead of a file reference.
Example Usage
Export a PNG Image
- Use Read Image or AI Modify Image to produce image data.
- Optionally process it with Rotate Image, Composite Image, or another image-processing node.
- Connect the image data to Data.
- Set Name to
"output-image". - Optionally set Path to
"exports/images". - Trigger Run from a Start node or another event.
The node saves output-image.png to the library and outputs the generated file reference.
tip
Use Get Library Download URLs after this node if you need a downloadable link for the generated PNG.