Skip to main content

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

InputTypeDescriptionDefault
RunEventTriggers the PNG creation and upload.-
DataDataThe image data to save. Supports a Jimp image object, base64 string, or Buffer.-
NameDataThe filename for the generated image. If the name does not end with .png, the extension is appended automatically.-
PathDataOptional 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

OutputTypeDescription
DoneEventFires when the node has finished running.
FileDataThe 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. .png is 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

  1. Use Read Image or AI Modify Image to produce image data.
  2. Optionally process it with Rotate Image, Composite Image, or another image-processing node.
  3. Connect the image data to Data.
  4. Set Name to "output-image".
  5. Optionally set Path to "exports/images".
  6. 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.