read_pfm: Read PFM image

View source: R/pfm.R

read_pfmR Documentation

Read PFM image

Description

Read PFM image

Usage

read_pfm(filename)

Arguments

filename

PFM filename or connection object. If filename ends with 'xz', 'bz2' or 'gz' suffix then it will be uncompressed automatically.

Value

If input PFM file is grayscale, a 2D numeric array is returned. If PFM file represents RGB color values, a 3D numeric array is returned.

See Also

Other PFM functions: write_pfm()

Examples

file <- system.file("image/rstats.pfm.bz2", package = "picohdr")
arr <- read_pfm(file)
arr[1:5, 1:5, ]

# Tone-map the image, gamma correct and plot
arr <- tm_reinhard_basic(arr)
arr <- adj_gamma(arr)
plot(arr)


picohdr documentation built on Oct. 28, 2024, 5:08 p.m.