Greyscale image to bitonal

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Post by glennrp »

  • -threshold
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Post by anthony »

If the pixels are pure and your IM is a Q16 then use..

Code: Select all

2^16 - 2   => 65534
EG:

Code: Select all

-threshold 65534
or more simply for all IM Q, negate the image threshold and negate back, so you don't have to deal with the color range.

Code: Select all

 -negate  -threhold 0  -negate
NOTE: if you want to make ALL pixels black, use a -threshold of '-1'
See
http://www.cit.gu.edu.au/~anthony/graph ... vas/#other
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply