contrast is a relative term, defineing the difference between the foreground and background levels.
It is also a very hard thing to differentiate, and not something you can easilly automate.
the best way may be to take a copy of the the image, blur it slightly, reduce it to two colors without dither, then use that to define what is 'foreground', using a trim.
See IM Example sections
Two Color Quantization
http://www.cit.gu.edu.au/~anthony/graph ... colors_two
And 'blurred trim'
http://www.cit.gu.edu.au/~anthony/graph ... #trim_blur
And please let us know how it goes, and what your final solution is..
finding highest point of contrast?
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/