| Title: | Read Windows Bitmap (BMP) Images |
|---|---|
| Description: | Reads Windows BMP format images. Currently limited to 8 bit greyscale images and 24,32 bit (A)RGB images. Pure R implementation without external dependencies. |
| Authors: | Gregory Jefferis [aut, cre] (ORCID: <https://orcid.org/0000-0002-0587-9355>) |
| Maintainer: | Gregory Jefferis <[email protected]> |
| License: | GPL (>=2) |
| Version: | 0.3.2 |
| Built: | 2026-05-19 07:45:33 UTC |
| Source: | https://github.com/jefferis/bmp |
This is really just to fix a limitation of readBin/R's 32 bit signed ints
ConvertIntToUInt(x, adjustment = 2^32)ConvertIntToUInt(x, adjustment = 2^32)
x |
Number to be fixed |
adjustment |
number to be added to convert to uint32 (2^32 by default) |
numeric value of uint32
jefferis
NB this just checks the magic 'BM' in the first two bytes of the file
is.bmp(source)is.bmp(source)
source |
file or connection |
TRUE or FALSE
jefferis
Limited to 8 bit greyscale images and 24 bit RGB images.
read.bmp(f, Verbose = FALSE)read.bmp(f, Verbose = FALSE)
f |
File to open |
Verbose |
Give verbose warnings (default FALSE) |
array of dims height x width x channels
jefferis
## Not run: library(pixmap) r=read.bmp('myrgbimage.bmp') pr=pixmapRGB(r) r=read.bmp('mygreyimage.bmp') pr=pixmapGrey(r) plot(pr) ## End(Not run)## Not run: library(pixmap) r=read.bmp('myrgbimage.bmp') pr=pixmapRGB(r) r=read.bmp('mygreyimage.bmp') pr=pixmapGrey(r) plot(pr) ## End(Not run)