How to Apply Gaussian Blur with ImageMagick Convert?

This article provides a quick overview and practical guide on how to apply a Gaussian blur to an image using the ImageMagick convert command. You will learn the basic syntax, how to control the blur intensity using radius and sigma values, and how to apply the effect selectively. By the end of this guide, you will be able to efficiently process single or multiple images directly from your command line.

The Basic Gaussian Blur Syntax

To apply a Gaussian blur in ImageMagick, you use the -blur option. The command requires two specific parameters: radius and sigma. The basic structure of the command looks like this:

magick convert input.jpg -blur {radius}x{sigma} output.jpg

Note: If you are using ImageMagick v7 or newer, the standard command is simply magick instead of magick convert, though convert is still widely supported for backward compatibility.

Understanding Radius and Sigma

The text formatting {radius}x{sigma} controls exactly how the blur is calculated and rendered onto your image.

Examples of Different Blur Intensities

Effect Level Command Example Result Description
Light Blur magick convert input.jpg -blur 0x2 output.jpg Subtle softening, ideal for minor noise reduction.
Medium Blur magick convert input.jpg -blur 0x5 output.jpg Noticeable blurring, good for obscuring text or details.
Heavy Blur magick convert input.jpg -blur 0x15 output.jpg Intense abstraction, perfect for creating artistic backgrounds.

Advanced Blurring Techniques

ImageMagick also allows you to control the direction of the blur or apply it to specific regions of an image.

Adaptive Blur

If you want to blur the image while preserving sharp edges, use the -adaptive-blur option. This is highly useful for reducing image noise without losing definition.

magick convert input.jpg -adaptive-blur 0x4 output.jpg

Directional (Motion) Blur

If you want the blur to mimic movement rather than spreading equally in all directions, you can use the -motion-blur option, which accepts a radius, sigma, and an angle.

magick convert input.jpg -motion-blur 0x8+45 output.jpg