How to Add Noise to an Image in ImageMagick?

This article provides a quick overview and practical guide on how to add digital noise to an image using the ImageMagick convert command. You will learn the exact syntax required, the different types of noise available, and how to control the intensity of the effect to simulate film grain or create artistic textures.

The Basic Syntax

To add noise to an image using ImageMagick, you use the -operator flag or the dedicated -evaluate / -noise functions, but the most direct and modern way to introduce random pixel variation is using the -attenuate and +noise operators.

Here is the standard syntax:

magick convert input.jpg -attenuate <value> +noise <NoiseType> output.jpg

(Note: If you are using ImageMagick v7 or later, the convert command is replaced by the primary magick command, though magick convert still works for backwards compatibility).

Breaking Down the Command

Supported Noise Types

ImageMagick allows you to choose from several algorithmic noise profiles depending on the visual effect you want to achieve:

Practical Examples

1. Adding Subtle Film Grain

To give a digital photo a classic, film-like texture, Gaussian noise with a low attenuation value works best:

magick convert photo.jpg -attenuate 0.5 +noise Gaussian grainy_photo.jpg

2. Adding Harsh Salt-and-Pepper Noise

To simulate a corrupted signal or a gritty, high-contrast look, you can use Impulse noise:

magick convert graphic.png -attenuate 1.5 +noise Impulse corrupted_graphic.png