pfstmo_mantiuk08 - Display adaptive tone mapping
pfstmo_mantiuk08 [--display-function
<df-spec>] [--display-size=<size-spec>]
[--color-saturation <float>]
[--contrast-enhancement <float>]
[--white-y=<float>]
[--fps=<frames-per-second>]
[--output-tone-curve=<file name>] [--verbose]
[--help]
This command applies the display adaptive tone mapping, which
attempts to preserve contrast of an input (HDR) image as close as possible
given the characteristic of an output display. Use this tone mapping
operator if you want to preserve original image appearance, or slightly
enhance contrast (-e option) while maintaining the natural look of
images. The operator can also compensate for ambient light reflections on a
screen, and for varying dynamic range and brightness of a display. The
operator is suitable for video sequences as it prevents high-frequency
changes in tone-curve between consecutive frames, which would result in
flickering. Note that the temporal filtering is always active and there is
no need to specify an argument to switch it on.
More details can be found in:
- Rafal Mantiuk, Scott Daly and Louis Kerofsky.
- Display Adaptive Tone Mapping.
- In: ACM Transactions on Graphics 27 (3), 2008.
- http://www.mpi-inf.mpg.de/resources/hdr/datmo/
If you find this TMO useful in your research project, please cite
the paper above.
This operator also employs color correction mechanism from:
- Radoslaw Mantiuk, Rafal Mantiuk, Anna Tomaszewska, Wolfgang Heidrich.
- Color Correction for Tone Mapping.
- In: Computer Graphics Forum (Proc. of EUROGRAPHICS'09), 28(2), 2009.
- http://zgk.wi.ps.pl/color_correction/
The result of this TMO does not require gamma correction.
- --display-function
<df-spec>, -d <df-spec>
- To adapt tone-mapping to different displays, this operator must be
provided a display function. The display function describes how output
luminance of a display changes with pixel values. If no parameter is
given, the command assumes -df pd=lcd (see
Pre-defined display below). There are several ways to
specify the display function:
- Gamma-gain-black-ambient
display model
- g=<float>:l=<float>:b=<float>:k=<float>:a=<float>[:n=<float>]
- Gamma-gain-black-ambient model can approximate a range of displays and is
a compact way to specify a display function. It assumes that a display
function has the following form:
- L_d(I) = (l-b)*I^gamma + b + k/pi*a
- The parameters are as follows:
- g -
- gamma or exponent of a display function (default 2.2, usually from 1.8 to
2.8)
- l -
- peak luminance of a display in cd/m^2 (default 100, from 80 for CRTs to
500 or more for newer displays)
- b -
- black level, which is luminance of a black pixel when the display is on
(default 1, usually from 0.3 to 1 cd/m^2)
- k -
- reflectivity of a screen (assuming that it is diffuse) (default 0.01,
usually about 0.01 (1%) for LCD displays, more for CRTs)
- a -
- ambient illumination in lux. Typical values are:
- 50 lux
- Family living room (dim, default)
- 400 lux
- A brightly lit office
- 32000 lux
- Sunlight on an average day (min.)
- 100000 lux
- Sunlight on an average day (max.)
- Pre-defined
display
- pd=<display_type>
- Use pre-defined display type. This options are for convenience only and
they do not mean to accurately model the response of a particular display.
The following display types are recognized:
- lcd_office
(g=2.2, l=100, b=0.8, k=0.01, a=400 )
- lcd set to "office" mode seen in bright environment
- lcd (g=2.2, l=200, b=0.8,
k=0.01, a=60 )
- typical lcd seen in dim environment (default)
- lcd_bright
(g=2.6, l=500, b=0.5, k=0.01, a=10 )
- newer LCD TV seen in dark environment
- crt (g=2.2, l=80, b=1,
k=0.02, a=60 )
- CRT monitor seen in dim environment
- The parameters in the parenthesis are the same as for the
gamma-gain-black-ambient model explained above.
- Lookup-table
- lut=<file>
- This is the most accurate specification of the display response function,
but requires measuring it with a luminance meter. The lookup table should
account also for ambient light, so that it is recommended to use the
luminance meter that can measure screen luminance from a distance, such as
Minolta LS-100 (as opposed to those that use rubber tube touching a
display that eliminates the influence of ambient light). The <file>
must be a comma-separated text file in a format (CSV) with two columns:
first column represents pixel values (from 0.0 to 1.0) and the second
physical luminance in cd/m^2. Both the pixel value and the luminance
should increase in each raw.
- --display-size=<size-spec>,
-s=<size_spec>
- Specifies how large the image appears to a viewer and what is the viewing
distance. If no parameter is given, -s ppd=30 is assumed.
Since this tone-mapper is global, display size has moderate effect on the
resulting images and thus skipping this parameter should not do much harm.
There are two ways to specify image size:
- vres=<lines>:vd=<screen_heights>[:d=<meters>]
- vres
- - screen's vertical resolution in lines, for example 1024.
- vd
- - viewing distance specified as multiplies of screen height. For example
if the display is seen from 0.5m and the height of its screen is 25cm,
vd=2.
- d
- - (optional) viewing distance in meters. This is to account for lower
eye's sensitivity for larger viewing distances (although the effect is
negligible). By default -d=0.5 is assumed.
- ppd=<pixels_per_visual_degree>[:d=<meters>]
- ppd
- - how many pixels spans one visual degree.
- d
- - (optional) viewing distance in meters. This is to account for lower
eye's sensitivity for larger viewing distances (although the effect is
negligible). By default -d=0.5 is assumed.
- --color-saturation
<float>, -c <float>
- Decrease or increase color saturation after tone mapping. Default value
-c=1 attempts to preserve color appearance of the original image.
Use values >1 to increase and <1 to decrease color saturation.
- --contrast-enhancement
<float>, -e <float>
- By default this tone-mapper attempts to preserve contrast of an input
image (-e=1). This parameter controls whether the contrast of an
input image should be enhanced before tone-mapping. For example
-e=1.15 boosts contrast by 15%. Note that if a target display does
not offer sufficient dynamic range, contrast may be enhanced only for
selected tone-values (those that dominate in an image) or not enhanced at
all.
- --white-y=<float>,
-y=<float>
- Tells the tone-mapper what luminance level in the input image should be
mapped to the maximum luminance of a display. Since HDR images contain
only relative luminance information, tone-mapper does not know how bright
should be the scene. This option is meant to fix this problem by providing
tone-mapper with the information what luminance level in an input image
should be perceived as a diffuse white surface. Default is none,
which means that no such mapping will be enforced and tone-mapper is free
to find an optimal brightness for a given image. This is a recommended
setting for HDR images. Setting --white-y could be necessary for
dark scenes, which could be made too bright by the tone-mapper. The value
of this parameter can be also passed in pfsstream as a tag WHITE_Y.
pfstools 1.7 and newer sets set this tag automatically for LDR images. The
command line option overrides the value of the pfstream tag.
- --fps=<frames-per-second>,
-f=<frames-per-second>
- Set the frame rate of the input sequence. Default is 25. Currently only 3
values are supported: 25, 30 and 60. This parameter controls temporal
filter that makes sure the resulting sequence is coherent in time. This
reduces the likelihood of a visible flicker.
- --output-tone-curve=<file
name>, -o=<file name>
- Write tone-curves to a text file. This option is mainly for debugging
purposes, but can be used to visualize computed tone-curves. The
tone-curve data is stored in a comma separated text file (CSV), consisting
of three columns: frame number, log10 of input luminance factor, log10 of
the resulting display luminance, and the pixel value (0-1).
- --verbose,
-v
- Print additional information during program execution.
- --quiet,
-q
- Do not display progress report.
- --help,
-h
- Print list of commandline options.
Please report bugs and comments to the pfstools discussion group
(http://groups.google.com/group/pfstools).