Hi all,
How do I get the x and y coordinates and the brightness of all the pixels that comprise an image? Is the exportPixels method in the magick wand the way to go? I need to get these values for each pixel. I have a program in ansi C to which I need to pass these coordinates. I can however use C++ too since I am probably going to convert that program to c++.
I have also seen the commandline interface where the convert utility looks promising. However, I cannot tell what parameters to use for this utility.
My program will run chiefly on Linux (Ubuntu) but I plan to run it on the rasbperry pie too.
Pranav
Getting pixel coordinates of individual pixels in an image
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Getting pixel coordinates of individual pixels in an ima
In command line, see the txt: format for output. It has color values and x,y coordinates.
What do you mean by "brightness"? Do you just have a grayscale image? Brightness is usually associated with the B channel of HSB colorspace. Similarly Lightness is the L channel of HSL colorspace. When converting to grayscale you get an intensity from a given combination of R/G/B, which is also the Y channel of YUV/YIQ/YCbCr colorspaces.
see http://www.imagemagick.org/Usage/files/#txt
convert image txt:
Sorry I am not sure how you would express that in one of the IM APIs.
What do you mean by "brightness"? Do you just have a grayscale image? Brightness is usually associated with the B channel of HSB colorspace. Similarly Lightness is the L channel of HSL colorspace. When converting to grayscale you get an intensity from a given combination of R/G/B, which is also the Y channel of YUV/YIQ/YCbCr colorspaces.
see http://www.imagemagick.org/Usage/files/#txt
convert image txt:
Sorry I am not sure how you would express that in one of the IM APIs.
Re: Getting pixel coordinates of individual pixels in an ima
[quote="fmw42"]In command line, see the txt: format for output. It has color values and x,y coordinates.
PL] Many thanks. The txt file is what I needed.
What do you mean by "brightness"? Do you just have a grayscale image? Brightness is usually associated with the B channel of HSB colorspace. Similarly Lightness is the L channel of HSL colorspace. When converting to grayscale you get an intensity from a given combination of R/G/B, which is also the Y channel of YUV/YIQ/YCbCr colorspaces.
PL] I am converting to grayscale so I am using the average of RGB values.
see http://www.imagemagick.org/Usage/files/#txt
PL] Yes and this helpped.
Pranav
PL] Many thanks. The txt file is what I needed.
What do you mean by "brightness"? Do you just have a grayscale image? Brightness is usually associated with the B channel of HSB colorspace. Similarly Lightness is the L channel of HSL colorspace. When converting to grayscale you get an intensity from a given combination of R/G/B, which is also the Y channel of YUV/YIQ/YCbCr colorspaces.
PL] I am converting to grayscale so I am using the average of RGB values.
see http://www.imagemagick.org/Usage/files/#txt
PL] Yes and this helpped.
Pranav
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Getting pixel coordinates of individual pixels in an ima
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/