mr.bio
mr.bio

Reputation: 1686

Get Pixel with Magic++

Can anybody show me an example how i get the pixel values of an Image ? I want to read an Image and iterate over it .. and print out the actual "red" value.

Can anyone help ? i'm a beginner :(

Upvotes: 0

Views: 1113

Answers (1)

Mihir Mehta
Mihir Mehta

Reputation: 13833

There is a direct function in magic++ called read in the image class:

image::read

i.e image.read( 640, 480, "RGB", CharPixel, pixels );

in which pixels will give you arrays of pixel values... that you can use later.

Or you can access direct low level pixels.. Here is how... http://www.imagemagick.org/Magick++/Image++.html#Raw%20Image%20Pixel%20Access

Upvotes: 1

Related Questions