"Stagecoach Wireless" <[email protected]> wrote:
> Is it possible to get a list of x-coord, y-coord, color code for each
> pixel contained in an image using IM?

Maybe what you're looking for is format conversion.  For 24bpp color images, I 
recommend converting to the PPM format, which is very easy to read.  For 
grayscale, used PGM.  PPM and PGM have ASCII and binary variants.  If you use 
the binary variant, once you read past the header, you can read or mmap the 
remainder of the file as a simple 2D array of pixels.

http://en.wikipedia.org/wiki/Netpbm_format

Here's an example command line that will convert formats:

$ convert my_input_image.jpeg my_output_image.ppm

MIFF is good too, but the header is a little bit more involved to read.  Both 
have ASCII-formatted headers, which is nice because you can view and edit them 
in an ordinary text editor.  But the data fields in PPM and PGM come in a fixed 
order, whereas in MIFF they are tagged (labeled) and can come in any order.  
PPM and PGM support comments in the header, which present the only difficulty 
in reading the header.

MIFF is far more flexible than PPM and PGM.  The extra features may or may not 
be helpful to you.  If you have to output images too, and if PPM and PGM aren't 
quite up to the task (for example, you want to put multiple images in a single 
file, or you want 48bpp color), you can open ImageMagick as a child process, 
pipe MIFF to its stdin, and have it convert to whatever final format you want.

-- 
Andy Goth | http://andy.junkdrome.org./
ununun...@{aircanopy.net,openverse.com}
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to