Hello everyone,
I do not know what I'm doing, but I think I know what I want to do. I was told, from (i believe) a reliable source, that somehow I could use ImageMagick or something similar to "read" an image file and essentially end up with an array of information for each pixel available. So say a 1024x768 image would result in a 1024x768 array in which each element of that array contained data relative to the pixel in its corresponding location. How could I go about achieving this? Obviously a step by step would be ideal but I'll take any help one is willing to offer.
Questions on Reading Images
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Questions on Reading Images
For acutal arrays look at NetPbmPlus
IM Examples, Formats, Other Formats
http://www.imagemagick.org/Usage/formats/#pbmplus
The ascii (non-binary) modes return just the numbers (triplets for RGB, single numbers for grayscale) when makes it ideal for generating arrays of values.
However the "txt" format is also useful when you just what a indexed list of values, or want to filter out or only read locations of specific colored pixels, (cor example using the "grep" UNIX text utility).
There are examples of feeding this to awk (another text utility) to do calculations on the data on the fly, for example rotate images (distort) based only on whole pixels.
http://www.imagemagick.org/Usage/distor ... rd_mapping
IM Examples, Formats, Other Formats
http://www.imagemagick.org/Usage/formats/#pbmplus
The ascii (non-binary) modes return just the numbers (triplets for RGB, single numbers for grayscale) when makes it ideal for generating arrays of values.
However the "txt" format is also useful when you just what a indexed list of values, or want to filter out or only read locations of specific colored pixels, (cor example using the "grep" UNIX text utility).
There are examples of feeding this to awk (another text utility) to do calculations on the data on the fly, for example rotate images (distort) based only on whole pixels.
http://www.imagemagick.org/Usage/distor ... rd_mapping
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/