read.bitmap {readbitmap}R Documentation

Read in a bitmap image in JPEG, PNG or BMP format

Description

By default uses magic byte to identify file (rather than the file extension) Currently uses readers in bmp, jpeg and png packages.

Usage

read.bitmap(f, channel, IdentifyByExtension = FALSE, ...)

Arguments

f

Path to image file

channel

Integer identifying channel to return for an RGB image

IdentifyByExtension

Identify by file extension only (Default FALSE)

...

Additional parameters passed to underlying image readers

Value

return value

See Also

readJPEG,readPNG,read.bmp

Examples

img1=read.bitmap(system.file("img", "Rlogo.jpg", package="jpeg"))
str(img1)
img2 <- read.bitmap(system.file("img", "Rlogo.png", package="png"))
# nb the PNG image has an alpha channel
str(img2)

[Package readbitmap version 0.1-4 Index]