How to negate image using ImageMagick

The ImageMagick convert tool can be used to negate an image using the -negate and +negate options. -negate replaces every grayscale or RGB pixel with its inverted or complementary color. Use +negate when you want to restrict this operation to only work on grayscale pixels.

Example:

$ convert -negate foo.png inverted_foo.png

Tried with: ImageMagick 6.9.7 and Ubuntu 18.04

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.