Convert bitmap to ascii triplets

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
markhowell
Posts: 1
Joined: 2011-05-10T17:12:07-07:00
Authentication code: 8675308

Convert bitmap to ascii triplets

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert bitmap to ascii triplets

Post 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.
Post Reply