OutputPNG
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
<module class = "OutputPNG" name = "OutputPNG" filename = "image%02d.jpg" />
Parameters
Name | Description | Type | Default |
---|---|---|---|
class | The class name for the module; must be "OutputPNG". | string | |
name | The name of this instance of the module. | string | |
filename | File 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 | |
suppress | Number of initial files to supress. Used to stop the write of the first images in a sequence before any output is available. | int | 0 |
offset | Value to add to the file index | int | none |
Module Connections
Inputs
Name | Description |
---|---|
INTENSITY | The gray level image data to be written to the file |
RED | The red channel image data to be written to the file |
GREEN | The green channel image data to be written to the file |
BLUE | The blue channel image data to be written to the file |
WRITE | Signal 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. |
Limitations
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.
Bugs
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.
Author
Jan Moren
jan.moren@lucs.lu.se
Lund University Cognitive Science
Files
OutputPNG.h
OutputPNG.cc
OutputPNG.ikc