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.
Store pixels in sub image wise in 2d array
-
- Posts: 43
- Joined: 2011-10-01T14:34:04-07:00
- Authentication code: 8675308
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Store pixels in sub image wise in 2d array
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
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
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Store pixels in sub image wise in 2d array
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.
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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/