Is it possible to read the pixel value at any particular x,y pixel coordinate using IM?
If so, how?
cheers
waggs
ImageMagick 6.8.6-6 2013-08-08 Q16
iMac
read pixel value
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: read pixel value
For example, to read the pixel from the in-built rose image at coordinate (40,50):
The result is: srgb(80,78,52)
Code: Select all
convert rose: -format "%[pixel:p{40,50}]" info:
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: read pixel value
see http://www.imagemagick.org/Usage/transform/#fx_escapes for more examples and discussion
Re: read pixel value
Thanks both - does what I want.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: read pixel value
If you are wanting a lot of pixels and not just one, then outputing the image as a "txt:" file will be better.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/