Examples

Quick-start guide and some interesting things you can do with pfstools.

Shell

View all HDR images (Radiance format) in a directory:
pfsv *.hdr
Convert all HDR files to the OpenEXR format:
for img in *.hdr; do pfsin ${img} | pfsout ${img%%.hdr}.exr; done
View all OpenEXR images, resize if larger than 512x512:
pfsin *.exr | pfssize --maxx 512 --maxy 512 | pfsview
View every 10th frame of the video sequence 0000.exr, 0001.exr, ...:
pfsin %04d.exr --frames 0:10:
View every 10th frame of the video sequence 0000.exr, 0001.exr, ...:
pfsin %04d.exr --frames 0:10:
Convert LDR image to the linear luminance values shown on a display with a gamma 2.6 and the peak luminance 200 cd/m^2:
pfsin img/tab_pfstools.png | pfsdisplayfunction --to-luminance -d g=2.6:l=200 | pfsview
Align a stack of RAW image exposures (from a Canon camera), resize them so that the width is equal or less 1200 pixels, align exposures, and merge them to an HDR image.
pfsinme *.CR2 | pfssize --maxx 1200 | pfsalign -v -c min | pfshdrcalibrate -r linear -v --bpp 16 | pfsout result.exr

See manual pages for more information on pfstools commands.

Matlab

Read color image into a (height x width x 3) matrix (pfstools >=1.8):
img = pfs_read_image( 'memorial.hdr' );
Read color image into a (height x width x 3) matrix (pfstools <=1.7):
img = pfs_read_rgb( 'memorial.hdr' );
View matrix using pfsview:
pfsview( img );
Save matrix as a luminance image:
pfs_write_luminance( 'new_image.exr', L );

See matlab interface documentation for more information on matlab functions.