Simple Unified Interface to Read Bitmap Images (BMP,JPEG,PNG,TIFF)

Identifies and reads Windows BMP, JPEG, PNG, and TIFF format bitmap images. Identification defaults to the use of the magic number embedded in the file rather than the file extension. Reading of JPEG and PNG image depends on libjpg and libpng libraries. See file INSTALL for details if necessary.

Build Status CRAN status


readbitmap is a simple R package that provides a function read.bitmap to read standard bitmap format images, identifying them by their image header (or magic value) rather than relying on the file extension.

  • See for online documentation.
  • Currently supports BMP, JPEG, PNG and TIFF images
  • ... via bmp, jpeg, png, and tiff packages.
  • includes function to identify images by magic values (standard file extensions can also be used)
  • Includes simple test suite


Regular CRAN Install


Latest Version

if (!require("devtools")) install.packages("devtools")


The jpeg, png, and tiff R packages depend on system libjpeg, libpng and libtiff libraries. These are pretty much always installed on unix like systems (e.g. linux, macosx). Failing that, see:

For Windows, binary installs of the jpeg and png packages include the libjpeg and lipng available on winbuilder and therefore no system library is required. The winbuilder libraries are part of a collection provied by Brian Ripley at:

The file is called at the time of writing.

For windows users building from source, the libraries are part of the Rtools bundle available at:


readbitmap 0.1.5

  • Added a file to track changes to the package.
  • Support for reading TIFF images thanks to Derek Ogle (#4)
  • read.bitmap now reads ARGB bmp images into RGBA array (#5) thanks to Simon Bartheleme (@dahtah).

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.1.5 by Gregory Jefferis, 3 years ago

Report a bug at

Browse source code at

Authors: Gregory Jefferis [aut, cre] , Derek Ogle [ctb] , Simon Barthelme [ctb]

Documentation:   PDF Manual  

GPL (>= 2) license

Imports bmp, jpeg, png, tiff

Suggests pixmap, testthat

System requirements: libjpeg, libpng

Imported by RFishBC, WindCurves, digitize, imagefluency, imager, sketcher.

Depended on by IPDfromKM.

See at CRAN