read.bitmap {readbitmap}R Documentation

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

Description

By default uses magic bytes at the start of the file to identify the image type (rather than the file extension). Currently uses readers in bmp, jpeg, png, and tiff 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

Objects returned by readJPEG, readPNG, read.bmp, or readTIFF. See their documentation for details.

See Also

image_type, readJPEG, readPNG, read.bmp, readTIFF

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.5 Index]