nice /usr/local/bin/convert \
-colors 2 \
-colorspace gray \
-compress group4 \
/var/www/html/uploads/pokemon.jpg \
/var/www/html/uploads/pokemontest.jpg
This command worked with a really OLD version of Image Magick.
With the newest version this method produces a completely black image.
nice /usr/local/bin/convert \
-colorspace gray \
-compress group4 \
/var/www/html/uploads/pokemon.jpg \
/var/www/html/uploads/pokemontest.jpg
nice /usr/local/bin/convert \
-colors 2 \
/var/www/html/uploads/pokemontest.jpg \
/var/www/html/uploads/pokemontestfinal.jpg
This results in a bitonal gray and black image, but it's really rough. NOT clean at all.
You could try a simple
convert input.jpg -threshold 50% output.jpg
(and play a bit with variations of the 50% setting) and see if this gets you any further.
Also, you may want to have a look at these answers:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With