Module used for writing an image (or sequences of images) to file(s). The files are saved in PNG format. For a gray scale image, connect only the INTENSITY input. For a color image, connect all of RED, GREEN and BLUE input (but not INTENSITY). To selectively output only certain images, connect the WRITE input. The PNG format is, unlike JPEG, lossless but takes up more space. If writing speed and small size is important, please use Jpeg. If precise fidelity is important, PNG is a good choice.

Example XML definition

A simple example

      class = "OutputPNG"
      name = "OutputPNG"
      filename = "image%02d.jpg"


classThe class name for the module; must be "OutputPNG".string
nameThe name of this instance of the module.string
filenameFile to write the output to. If a sequence will be produced %d must be included in the name. It will be replaced with the sequence number of the file. Standard C formats can be used, e. g. %02d will insert the number with two figures and an initial '0'. With no sequence to generate, the module will repeatedly write to the same filename, leaving the last written image in the file.string
suppressNumber of initial files to supress. Used to stop the write of the first images in a sequence before any output is available.int0
offsetValue to add to the file indexintnone

Module Connections


INTENSITYThe gray level image data to be written to the file
REDThe red channel image data to be written to the file
GREENThe green channel image data to be written to the file
BLUEThe blue channel image data to be written to the file
WRITESignal to write or suppress a given image. If connected, an image will only actually be written if the value of the WRITE input is greter than 0. The file counter will still increase.


We aren't using all of PNG:s strenghts - no 16 bit output, no indexed color for smaller files and no way to create an alpha channel.


If %d is not in the filename each new file will overwrite the previous. This is a feature, since you can create a named pipe and in that way stream images to another application.


Jan Moren
Lund University Cognitive Science



blog comments powered by Disqus