Reference Talk:File Output Options

From POV-Wiki
Jump to navigation Jump to search

Output File Type

Sets file output format to x
Sets file output on; sets format x, depth n
Sets file output off; but in future use format x, depth n
Sets alpha output on/off
Sets alpha output on
Sets alpha output off
Sets file output bits/color to n
Sets compression parameter for file types that support it.

Note: As of version 3.7 the default output file type for all supported platforms is PNG. You may select one of several different file types by using Output_File_Type=x or +Fx where x is one of the following:

.. B
Universal Bitmap image file format
.. C
Compressed Targa-24 format (RLE, run length encoded)
.. E
OpenEXR High Dynamic-Range format
.. H
Radiance High Dynamic-Range format
.. J
JPEG format (Note: This format is not loss-free and will generate compression artifacts)
.. N
PNG (portable network graphics) format
.. P
Unix PPM format
.. S
System-specific format: See the notation at the end of this section.
.. T
Uncompressed Targa-24 format

New as of version 3.7.1, instead of Output_File_Type=C you can also use Output_File_Type=T Compression=1 to choose RLE-encoded Targa format.

PNG is an image format designed not only to replace GIF, but to improve on its shortcomings. PNG offers the highest compression available without loss for high quality applications, such as ray-tracing.

New Prior to version 3.7.1, PPM output always created the compact raw (binary) format. The Compression=0 ini setting can now be used to select the plain (ASCII) format instead.

The system specific format depends on the platform used and is covered in the appropriate system specific documentation.

JPEG is particularly good at achieving high compression rates with photographic or photorealistic images, making it one of the most frequently used formats on the Internet. However, it is not loss-free. Images generated with this option will always contain compression artifacts (image defects). If you need to keep a high-quality image you should render using one of the loss-free formats.

Note: Chroma sub-sampling has been disabled in JPEG output, and there has been a reduction in the default quality setting.

The JPEG compression quality can be controlled using the Compression ini file option which, if set, needs to be an integer between 0 and 100. If values of 0 or 1 are specified then the default compression quality setting of 85% is used. Otherwise the value specified (2-100) is used as the compression quality setting. A value of 2 produces the smallest file (maximum compression), but looks terrible. A value of 100 produces the largest file (least compression) but can still contain some compression artifacts. Values lower than 0 are clipped to 0. Values greater than 100 are clipped to 100.

Most of these formats output 24 bits per pixel with 8 bits for each of red, green and blue data. PNG and PPM allow you to optionally specify the output bit depth from 5 to 16 bits for each of the red, green, and blue colors, giving from 15 to 48 bits of color information per pixel. The default output depth for all formats is 8 bits/color (16 million possible colors), but this may be changed for PNG and PPM format files by setting Bits_Per_Color=n or by specifying +FNn or +FPn, where n is the desired bit depth.

Specifying a smaller color depth like 5 bits/color (32768 colors) may be enough for people with 8- or 16-bit (256 or 65536 color) displays, and will improve compression of the PNG file. Higher bit depths like 10 or 12 may be useful for video or publishing applications, and 16 bits/color is good for grayscale height field output (See section Height Field for details on height fields).

Targa format also allows 8 bits of alpha transparency data to be output, while PNG format allows 5 to 16 bits of alpha transparency data, depending on the color bit depth as specified above. You may turn this option on with Output_Alpha=on or +UA. The default is off or -UA.

The alpha channel stores a transparency value for each pixel, just like there is also stored a value for red green and blue light for each pixel. In POV-Ray, when the alpha channel is turned on, all areas of the image where the background is partly or fully visible will be partly or fully transparent. Refractions of the background will also be transparent, but not reflections. Also anti-aliasing is taken into account

The philosophy of the alpha channel feature in POV-Ray is that the background color should not be present in the color of the image when the alpha channel is used. Instead, the amount of visible background is kept in the alpha and *only* in the alpha channel. That ensures that images look correct when viewed with the alpha channel.

See section Using the Alpha Channel for further details on using transparency in imagemaps in your scene.

Note: In version 3.7 alpha handling for image file output has changed. Effectively, the background now requires a filter or transmit value in order for alpha transparency to work properly.

Previous versions of POV-Ray always wrote associated alpha for output, this has been changed on a per-file-format basis as follows:

  • PNG will use straight alpha as per specification.
  • OpenEXR and TIFF (Editor's Note: TIFF output is not supported) will use associated alpha as per specifications.
  • TGA and BMP 32-bit RGBA will use straight alpha, retaining file input compatibility for now, until a final decision has been made on these formats.

In addition to support for variable bit-depths, alpha channel, and grayscale formats, PNG files also store the File_Gamma value so the image displays properly on all systems. The hf_gray_16 global setting, as described in section HF_Gray_16 will also affect the type of data written to the output file.

The Radiance Synthetic Imaging System or .hdr image format was originally developed to aid lighting designers and architects by predicting the light levels and appearance of a space prior to construction. The OpenEXR or .exr image file format was developed by Industrial Light & Magic™ for use in computer imaging applications.

Most image formats now include metadata (BMP is a notable exception). This metadata contains the POV-Ray version, render date/time (GMT), platform (e.g. x86_64-pc-win), and compiler used to build the POV-Ray executable.

Note: System-specific or type "s" output file format is being retained for legacy support reasons. Windows and Unix mapping remains the same, BMP and TGA respectively, however on Macintosh it has been changed to PNG, and a warning is issued when type "s" is used.