Page 1 of 1
Store pixels in sub image wise in 2d array
Posted: 2012-01-06T13:35:39-07:00
by rohitkrishna
Hi Everyone,
Can any one please explain me how can i store the r,g,b values of a image..by sub-image wise in a 2d array using image magick...?
Lets say an image is of 15x15..i have to store the r,g,b values in 2d array by 5x5 sub-images...wise.
Re: Store pixels in sub image wise in 2d array
Posted: 2012-01-06T17:06:26-07:00
by fmw42
I think this needs a bit more clarification. Are you trying to take every 15x15 pixel region from the image and make a new 15x15 pixel image for each region? Is there overlap of the regions in the input image? Do I totally misunderstand what you want?
Take a look at the -crop operator at:
http://www.imagemagick.org/Usage/crop/#crop
and especially at
http://www.imagemagick.org/Usage/crop/#crop_tile
Re: Store pixels in sub image wise in 2d array
Posted: 2012-01-08T18:55:55-07:00
by anthony
OR are you just wanting to read the data.. If so what language? What data format?
You are not detailed enough for us to help.
PS: one simple universal way is to just get Im to output a TXT: file (enumerated pixel format)
See
http://www.imagemagick.org/Usage/files/#txt
Also see the section.. Extracting Image Colors.
http://www.imagemagick.org/Usage/quantize/#extract
These are however specific to command line, for other API's other techniques are available.