Page 1 of 1

Convert bitmap to ascii triplets

Posted: 2011-05-10T17:32:49-07:00
by markhowell
I have a series of bitmaps that will be used to create a 3-D data volume in geographic space. Each bitmap represents x,z space, and each pixel is thought to have a value "p". Would like to run a batch process to convert each bitmap to an ascii file composed of "x", "z" and "p" values. The "y" value is given by the bitmap file name. The ultimate goal is a spreadsheet that has a separate row for each x,y,z,p combination. Will ImageMagick facilitate this? Thank you.

Re: Convert bitmap to ascii triplets

Posted: 2011-05-10T18:03:39-07:00
by fmw42
see txt: format which you can write to a file if you want.

http://www.imagemagick.org/Usage/files/#txt


you will have to extract the first 3 values: x,z,p from the rows x,y: (p,p,p) ... assuming the bitmap is grayscale, but sed for example will do that.