Hi R users,
I have a xml file. A value of one of the nodes of the xml file is a bmp
image(RAW format) encoded in base64. I would like to read this image by R. I
think I should do the following steps:

1. Decoding it from base64 to binary.
2. Removing the header of the image file
3. building the matrix

So I wonder if you know how to do the following using R functions:
1. decode from base64 to binary. base64decode does not decode to binary. The
binary file is an openable bmp file.
2. Remove the header of bmp image and produce a matrix which has the color
values.

My main goal is producing the matrix which has the color values, if the
aforementioned steps don't look plausible, what is your suggested steps.

Right now I produce the matrix, using the following steps, but I wonder if I
can avoid using Image Magic and python.

1. Decoding from base64 to binary using a python function. After decoding I
have a openable image file.
2. Converting bmp format to pnm using Image Magic program
3. Reading pnm format using pixmap library in R. The function read.pnm
produces a pixmap object
4. Producing matrices using pixmap object

Thanks for your help,
Rostam

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to