Skip to the tutorial
lil cactus

How to add a border to an image

Beginner5 minutesUpdated

Quick answer

In Lil Cactus, choose Image then Canvas Size… and increase both dimensions by twice the border width, using the Center anchor. Add Layer then New Fill Layer then Solid Color…, enter FFFFFF in the # field for white and click Apply. Choose Layer then Arrange then Send Layer Backward to put the color behind the photo, then export with File then Export then PNG…

A cloud photo on an enlarged canvas, first with checkerboard margins and then with an opaque white frame
Before: added canvas space is transparent. After: a white fill behind the photo makes the frame. Drag the handle to compare.
Time
5 minutes
Level
Beginner
You need
A photo and a border width in pixels
Works with
JPG, PNG, WebP and other images you can open
Open the sample in Lil CactusUse your own photo

Free, no sign-up. Your photo stays on your computer.

Use extra canvas space when you want a frame outside the photo. A fill layer supplies the color, while the photo sits above it. For an outline that fits inside the existing image dimensions, use the Stroke variation below.

Add an outside frame in five steps

  1. Open the photo

    Open the sample from this page, or choose File then Open… for your image.

  2. Make room around the photo

    Choose Image then Canvas Size… For a 60 px border around the sample, enter Width (px) 1656 and Height (px) 1144. Keep the middle Center anchor selected and click Resize. Checkerboard space appears around all four edges.

    Canvas Size with whole Width 1656 and Height 1144 fields, Center anchor and Resize ringed
    Center divides the added space between opposite edges.
  3. Choose the frame color

    Choose Layer then New Fill Layer then Solid Color… In Solid Color Fill, enter FFFFFF in the # field for white, or another six-character color code for a colored frame. Click Apply. The fill initially covers the photo.

    Solid Color Fill dialog with the full hex field showing FFFFFF and Apply button ringed
    FFFFFF is white. The new color fills a separate layer.
  4. Put the color behind the photo

    With Color Fill still selected, choose Layer then Arrange then Send Layer Backward. In the Layers panel, the photo is now above the fill. Its original edges remain visible inside the frame.

    Layers panel showing Background above the selected white Color Fill layer
    The opaque photo covers the middle of the fill layer.
  5. Export the framed image

    Choose File then Export then PNG…, enter framed-sky.png in File name and click Export.

    File then Save As then Lil Cactus Project… keeps the photo and fill as separate editable layers. File then Save then updates that project. Before you save a project, File then Save writes the framed image back into the JPEG you opened, as a flat image, and may first open Save Image for its settings.

    File name label and field ringed, showing framed-sky.png
    Name the framed copy.
    Export button ringed beside Cancel in the export dialog footer
    Export writes the image copy.

Keep the original dimensions with Stroke

Open the original photo again. Choose Layer then Layer Style then Layer Style…, then click Stroke in the left list. Set Size to 24 px and Position to Inside.

Click the Color swatch, enter FFFFFF in the # field and click OK. Click OK in Layer Style too. The stroke covers a strip of the photo along each edge, so keep important details away from the border. Export it as in step 5, with a new file name such as stroked-sky.png.

Layer Style effects list with the complete enabled Stroke row ringed
Choose Stroke in the left list.
Stroke settings with Size 24, the whole Position control set to Inside, the Color swatch and OK ringed
Set Size and Position, then click the Color swatch.
Color dialog with the full hex field showing FFFFFF and OK ringed
Set the stroke color here.
The cloud photo with a white stroke inside its original rectangular edges
The inside-stroke version uses the original canvas dimensions.

What to do next

Image borders: questions and answers

Does adding a border stretch my photo?

No. In Lil Cactus, Canvas Size adds space around the photo rather than stretching it. The outer rectangle can have a different aspect ratio after you add equal-width margins.

Why is one side of my image border a pixel wider?

An odd increase in canvas width or height cannot split evenly into whole pixels. In Lil Cactus, increase that dimension by an even number and use the Center anchor for equal opposite margins.

Can I export a framed photo as a JPEG?

Yes. In Lil Cactus, choose File then Export then JPEG… and click Export. JPEG keeps the visible frame and combines the layers into one flat image.

Why does an Outside Stroke layer style disappear around my photo?

In Lil Cactus, an Outside Stroke on a photo that reaches every canvas edge falls beyond the exported image. Use Inside in Layer Style to draw it within the canvas.

Why does Stroke outline the subject instead of the photo rectangle?

In Lil Cactus, Stroke follows the visible edges of the layer’s pixels. A cut-out on transparency therefore gets a subject outline; the full opaque photo used here gets a rectangular frame.