Get RGB info of one pixel

Started by marciano, June 15, 2025, 08:14:32 AM

Previous topic - Next topic

marciano

Is it possible to get RGB values of the top left pixel of a jpg photo?

marciano

Pixel position (n,m).
Image Magick Linux command line: convert photo.jpg[1x1+n+m] -format "%[fx:int(255*r)],%[fx:int(255*g)],%[fx:int(255*b)]" info:
Output: red value, green value, blue value

Source: https://www.imagemagick.org/discourse-server/viewtopic.php?p=46471#p46471

StarGeek

Glad you found a solution.

Exiftool would not be a solution here. Exiftool only deals with metadata. It has no ability to read image data.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype