pcond - condition a RADIANCE picture for output


pcond [ options ] input [ output ]


Pcond conditions a Radiance picture for output to a display or hard copy device. If the dynamic range of the scene exceeds that of the display (as is usually the case), pcond will compress the dynamic range of the picture such that both dark and bright regions are visible. In addition, certain limitations in human vision may be mimicked in order to provide an appearance similar to the experience one might have in the actual scene.

Command line switches turn flags off and on, changing program behavior. A switch given by itself toggles the flag from off to on or on to off depending on its previous state. A switch followed by a ’+’ turns the option on explicitly. A switch followed by a ’-’ turns the option off. The default is all switches off. Other options specify output device parameters in order to get more accurate color and contrast.


Mimic human visual response in the output. The goal of this process is to produce output that correlates strongly with a person’s subjective impression of a scene. This switch is a bundle of the -a, -v, -s and -c options.


Defocus darker regions of the image to simulate human visual acuity loss. This option will not affect well-lit scenes.


Add veiling glare due to very bright regions in the image. This simulates internal scattering in the human eye, which results in a loss of visible contrast near bright sources.


Use the human contrast sensitivity function in determining the exposure for the image. A darker scene will have relatively lower exposure with lower contrast than a well-lit scene.


If parts of the image are in the mesopic or scotopic range where the cone photoreceptors lose their efficiency, this switch will cause a corresponding loss of color visibility in the output and a shift to a scotopic (blue-dominant) response function.


Use a center-weighted average for the exposure rather than the default uniform average. This may improve the exposure for scenes with high or low peripheral brightness.

-i fixfrac

Set the relative importance of fixation points to fixfrac, which is a value between 0 and 1. If fixfrac is zero (the default), then no fixation points are used in determining the local or global adaptation. If fixfrac is greater than zero, then a list of fixation points is read from the standard input. These points are given as tab-separated (x,y) picture coordinates, such as those produced by the -op option of ximage(1). The foveal samples about these fixation points will then be weighted together with the global averaging scheme such that the fixations receive fixfrac of the total weight. If fixfrac is one, then only the fixation points are considered for adaptation.


Rather than computing a histogram of foveal samples from the source picture, use the precomputed histogram provided on the standard input. This data should be given in pairs of the base-10 logarithm of world luminance and a count for each bin in ascending order, as computed by the phisto(1) script. This option is useful for producing identical exposures of multiple pictures (as in an animation), and provides greater control over the histogram computation.


Use a linear response function rather than the standard dynamic range compression algorithm. This will prevent the loss of usable physical values in the output picture, although some parts of the resulting image may be too dark or too bright to see.

-e expval

Set the exposure adjustment for the picture to expval. This may either be a real multiplier, or a (fractional) number of f-stops preceeded by a ’+’ or ’-’. This option implies a linear response (see the -l option above).

-u Ldmax

Specifies the top of the luminance range for the target output device. That is, the luminance (in candelas/m^2) for an output pixel value of (R,G,B)=(1,1,1). The default value is 100 cd/m^2.

-d Lddyn

Specifies the dynamic range for the target output device, which is the ratio of the maximum and minimum usable display luminances. The default value is 100.

-p xr yr xg yg xb yb xw yw

Specifies the RGB primaries for the target output device. These are the 1931 CIE (x,y) chromaticity values for red, green, blue and white, respectively.

-f macbeth.cal

Use the given output file from macbethcal(1) to precorrect the color and contrast for the target output device. This does a more thorough job than a simple primary correction using the -p option. Only one of -f or -p may be given.

-x mapfile

Put out the final mapping from world luminance to display luminance to mapfile. This file will contain values from the minimum usable world luminance to the maximum (in candelas/m^2) in one column, and their corresponding display luminance values (also in candelas/m^2) in the second column. This file may be used for debugging purposes, or to plot the mapping function created by pcond.


To display an image as a person might perceive it in the actual scene:

pcond -h final.hdr > display.hdr

ximage display.hdr ; rm display.hdr &

To do the same on a 24-bit display with known primary values:

setenv DISPLAY_PRIMARIES ".580 .340 .281 .570 .153 .079 .333 .333"

pcond -h -p $DISPLAY_PRIMARIES final.hdr | ximage &

To prepare a picture to be sent to a film recorder destined eventually for a slide projector with a minimum and maximum screen luminance of 1.5 and 125 candelas/m^2, respectively:

pcond -d 83 -u 125 final.hdr > film.hdr

To do the same if the output colors of the standard image "ray/lib/lib/macbeth_spec.hdr" have been measured:

macbethcal -c mbfilm.xyY > film.cal

pcond -d 83 -u 125 -f film.cal final.hdr > film.hdr

To further tweak the exposure to bring out certain areas indicated by dragging the right mouse button over them in ximage:

ximage -op -t 75 final.hdr | pcond -i .5 -d 83 -u 125 -f film.cal final.hdr > film.hdr

To use a histogram computed on every 10th animation frame:

phisto frame*0.hdr > global.hist

pcond -I -s -c frame0352.hdr < global.hist | ra_tiff - frame0352.tif


Greg Ward Larson, Holly Rushmeier, Christine Piatko, ‘‘A Visibility Matching Tone Reproduction Operator for High Dynamic Range Scenes,’’ IEEE Transactions on Visualization and Computer Graphics , December 1997.



Greg Ward Larson


getinfo(1), macbethcal(1), normtiff(1), pcompos(1), pflip(1), phisto(1), pinterp(1), pvalue(1), protate(1), ra_xyze(1), rad(1), rpict(1), ximage(1)