Skip to main content

Write JPEG

Controlled node

Overview​

The Write JPEG node saves image data as a JPEG file in the project library. It is useful at the end of an image workflow when you want to export a processed image, generated image, or base64 image payload as a library file.

Inputs​

InputTypeDescriptionDefault
RunEventTriggers the JPEG 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 .jpeg or .jpg, .jpeg is appended automatically.-
PathDataOptional folder path in the library where the JPEG 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 JPEG can be uploaded to the project library.
  • Filename Handling: The node requires a non-empty Name input. .jpeg is appended if neither .jpeg nor .jpg is present.
  • Directory Creation: If Path is provided, the node creates or resolves that library folder path before uploading.
  • Image Conversion: Jimp images are encoded as JPEG. 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 Processed Image​

  1. Use Read Image to load a library image.
  2. Process it with Resize Image, Crop Image, or another image-processing node.
  3. Connect the processed image to Data.
  4. Set Name to "processed-image".
  5. Optionally set Path to "exports/images".
  6. Trigger Run from a Start node or another event.

The node saves processed-image.jpeg 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 JPEG.