Looking for fast way to extract pixel values

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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Looking for fast way to extract pixel values

Post by magick »

The fastest way to extract pixels is to use an API call. Pick your favorite language and read an image then extract pixels. See http://www.imagemagick.org/script/magick-wand.php for a method. A second method on that page can process pixels in parallel on a multi-core system for even better performance.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Looking for fast way to extract pixel values

Post by anthony »

If it is only one pixel, crop the read either during the read, using special read options,
http://www.imagemagick.org/Usage/files/#read_mods
or using -crop, and then output a txt: Enumerated Pixel Image

For the whole image the txt: image is a still good solution.
http://www.imagemagick.org/Usage/files/#txt

But in a larger program, or or scattered pixels using the right API interface, as mentioned by Cristy (magick) is the better solution.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply