How to get RGB values using JMagick(a wrapper of imagemagick) ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you want to get the “red” value of a specific image, on the commandline, you could use the following syntax. For the JMagick API, just look up how you’ll have to translate this into API calls:
fx:is ImageMagick’s special effects image operator that allows you to query all sorts of properties from an image, use them in a mathematical expression and apply them on the image;s.tells ImageMagick to select the current image in the sequence for applying the fx operation;p{111,111}.tells fx to use the pixel at column 111, row 111 for this operation (if you skip the pixel coordinates, fx defaults top{0,0}, which is the pixel in the top left corner;rqueries the red channel of the selected pixel;0.427451is the result: it means it is 42.7451% of the maximum value of the channel (255 for 8-bit, 65535 for 16-bit).zqueries the channel depth used for the pixel. Result is 8.You can also query the Hue, Saturation and Lightness values for a pixel after converting the image to the HSL color system: