How to Create a Vignette Effect with ImageMagick?

Creating a vignette effect—where the edges of an image softly fade into a dark or colored border—is a popular way to draw focus to a central subject. By utilizing ImageMagick’s powerful convert command (or the magick command in newer versions), you can easily generate this artistic effect directly from your terminal. This guide walks you through the core command structure, explains how the underlying masking process works, and provides customizable examples to adjust the intensity and color of the vignette.

The Standard Vignette Command

ImageMagick provides a built-in -vignette operator designed specifically for this task. It uses a geometry syntax to control the falloff of the effect. The standard syntax looks like this:

magick input.jpg -vignette 0x20 output.jpg

In this command, the parameters 0x20 control the radius and the sigma (blur amount) of the vignette.

Customizing the Vignette with Masks

If you want more control over the shape, color, and transparency of the vignette, you can manually create a black-and-white radial gradient mask and composite it over your image. This method allows you to change the border color from black to white (a “wedding” vignette) or any other shade.

Here is how to create a dramatic black vignette using a generated gradient:

magick input.jpg ( -size 800x600 canvas:black ( -size 800x600 radial-gradient:white-black ) -alpha off -compose CopyOpacity -composite ) -compose Over -composite output.jpg

Note: Replace 800x600 with the actual pixel dimensions of your input image to ensure the mask aligns perfectly.

Advanced Vignette Variations

You can tweak the parameters to achieve different photographic styles: