Yi-Xiong Zhou
2003-Nov-21 23:57 UTC
[R] How to read .bmp files into R? read.pnm throws error
Hi, Is there a way to read .bmp files into R? I have tried read.pnm from pixmap package. It returned Error in pm.readmagicnumber(con) : Not a PNM format file Anyother ways to load bitmap images? Yi-Xiong
Duncan Murdoch
2003-Nov-22 00:37 UTC
[R] How to read .bmp files into R? read.pnm throws error
On Fri, 21 Nov 2003 15:57:35 -0800, you wrote:>Hi, > >Is there a way to read .bmp files into R? I have tried read.pnm from pixmap >package. It returned > >Error in pm.readmagicnumber(con) : Not a PNM format file > >Anyother ways to load bitmap images?.bmp format is fairly simple, and is well documented (e.g. see www.wotsit.org). It wouldn't be hard to write a reader using connections. The only difficulty is that several pixel formats are available. However, if you have control of the creation of the files, you can choose 24 bit BMPs, which are the simplest to read. Duncan Murdoch