Adding a border to your images

When we project images at club meetings, the screen around the image appears black. or near-black. If your image has large dark areas running to the edge of the image these tend to blend into the background and viewers’ eyes can wander out of the frame. The same is true in inverse when images are presented on web sites against a white or other light background.

The solution to this is to add a narrow border in a contrasting colour to the image, which is enough to keep eyes from straying beyond the frame. This was mentioned in our latest newsletter with this link to a tutorial on one way to do it. That method involves increasing the canvas size and could lead to problems for those of our members already having problems in sizing their submissions for meetings. Here I provide an alternative way to to this that does not increase the image dimensions. The benefit of this is that you can export or save your club-ready image in the correct size then open it and apply this technique without affecting the image dimensions.

I am going to demonstrate using Adobe Photoshop, in this case Elements 7. The technique uses no advanced features and can be done with any version of Photoshop released in the past decade, as well as many other applications, though steps (and terminology) will differ.

Lets start off by looking at our sample image on a dark background.


We see that there is no definition at the edges of dark areas of the photo and light areas like the light streams appear to end suddenly in mid-space. In this case, and it varies from image to image, a narrow light-coloured border would be most suitable, so let’s see how to add one without affecting the image size.

Open the image in Photoshop and select the entire image using the Select | All menu or by pressing Ctrl-A (Cmd-A on Mac). You will see the marching ants indicating the entire image is selected.


We could shrink the selection, invert it so the outer edge is selected, then fill the selection with colour to create the border, but there is an easier way. Click the Edit | Stroke (Outline) Selection… menu to reveal the Stroke dialog.


If this is not the first time you are doing this the settings in the dialog may be correctly remembered from before, but we should check them anyway.

In the Stroke group, set the Width to 1 px (one pixel); use a larger value if you want a wider border. Click the Color swatch to open the Select stroke color: dialog and choose a mid-grey colour. The easiest way to do this is to grab the little circle and drag it down the left edge of the selector until the R, G and B values are all 127. Or you could just type 127 into each of the R, G and B fields.


Why don’t we use white for the border? A white border is in high contrast to the dark background and tends to distract from the image itself so it’s better to use a darker shade. It will be less distracting but still keep the eye from straying beyond the frame.

Click OK to dismiss the colour selector and return to the Stroke dialog. Location controls where the border will be drawn; Outside will draw outside the marching ants for the selected width and Center will draw along the marching ants drawing half the width inside of and half the width outside of the marching ants. What we want here is to select Inside so the full width we selected is drawn inside the marching ants.

Blending can be left at or reset to the defaults. Mode should be Normal, Opacity 100% and Preserve Transparency should not be available as your image has no transparency.

Having clicked OK to dismiss the Stroke dialog you won’t see that anything has happened as the border you just drew is hidden by the marching ants. Press Ctrl-D (Cmd-D on Mac) and you should see it. Depending on the size of the image and the magnification of the Photoshop view you may still not see it but id you zoom onto a corner or edge of the image you’ll see the border we created.


Now save the image and you’re done. When projected at the club on a dark background it will look like this and provide a better viewing experience.


Sometimes we may want to create a more complex border consisting of two or more lines in different colours. This can also easily be achieved with this technique, again without affecting the dimensions of the image. All we have to do is repeat the stroke operation for each different colour, starting with the innermost. Lets look at the case where we want to create a one pixel mid-grey border as we did before but also want a five pixel border inside that using a colour from the image. Repeat the steps we did before to the point you have the entire image selected.

We want to use the orange colour from the image for the inner border so we’ll use border_tut_07the eyedropper tool to pick it up from the image. Notice that the foreground colour swatch is now orange. Now click the Edit | Stroke (outline) selection… menu and notice that the selected foreground colour (orange) is automatically set in the dialog.


We want to draw a five pixel wide orange border but there is going to be a one pixel border around that so we must add 1 + 5 and make the width 6 px. Click OK to dismiss the dialog and we see the orange border, as it’s wider than the marching ants. Now, without deselecting, repeat the Edit | Stroke (Outline) selection… action, choosing Width as 1 px and Color as the mid-grey we used before. Now we have a border that looks like this, as it turns out not a very pleasing colour combination, but luckily this was just for demonstration.


Published by Steve Crane

Programmer and amateur photographer.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: