You could write it to BMP with rgdal, i.e. with dummy "world" coordinates:
x1 <- list(x = 1:5, y = 1:4, z = matrix(1:20, 5, 4))
require(sp)
x2 <- image2Grid(x1)
require(rgdal)
writeGDAL(x2, "file.bmp", driver = "BMP", type = "Byte", mvFlag = 255)
(I am not familiar with the details of what BMP
I don't know if any R-packages exist that can do this, but you could
install imagemagick (http://www.imagemagick.org), which provides
command line tools for image manipulation and conversion, and call
these from R using system. Something like:
system("convert yourimage.ppm yourimage.bmp")
Dear all,
Several days ago, I posted How to write a bmp file pixel by pixel.
Instead of bmp, I succeeded in writing a PPM file by using the pixmap package.
Thanks for the hint generously provided by Uwe Ligges.
Now I have a new question. How to convert a PPM file to BMP file in R
3 matches
Mail list logo