How to Create a Polaroid Frame with ImageMagick?
This article provides a quick overview and step-by-step guide on how
to use the ImageMagick convert command to transform a
standard image into a classic, retro Polaroid-style photo. You will
learn the exact command-line syntax required to add the characteristic
wide white borders, a subtle drop shadow, and custom text to the bottom
margin of your image.
The Basic Polaroid Command
ImageMagick includes a built-in -polaroid operator that
automates most of the styling, including the border, a slight artistic
rotation, and a drop shadow.
Here is the fundamental command to achieve this effect:
magick convert input.jpg -bordercolor white -background black +polaroid output.jpg
Note for ImageMagick v7+: Modern versions of ImageMagick use the
magickcommand instead of justconvert. If you are using an older version (v6 or earlier), you can omitmagickand start the command directly withconvert.
Adding Custom Text to the Margin
One of the most iconic features of a Polaroid photo is the
handwritten note at the bottom. You can use the
-set caption option to add your own text to the frame
before applying the effect.
magick convert input.jpg -background black -set caption "Memories of 2026" -bordercolor white +polaroid output.jpg
Breaking Down the Command Options
To customize the output further, it helps to understand what each part of the command is doing:
-set caption "Your Text": Defines the text that will be printed on the bottom white margin of the Polaroid frame.-bordercolor white: Specifies that the frame surrounding the image should be white.-background black: Sets the background color behind the final image. Because the Polaroid effect slightly rotates the picture, this color will fill the empty corners of the canvas. You can change this tononefor a transparent background.+polaroid: Applies the actual effect. Using+polaroidapplies a random, slight angle rotation. If you prefer a completely straight image with no tilt, use-polaroid 0instead.