Convert bitmap to ascii triplets
-
- Posts: 1
- Joined: 2011-05-10T17:12:07-07:00
- Authentication code: 8675308
Convert bitmap to ascii triplets
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.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Convert bitmap to ascii triplets
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.
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.