How To Add Borders

Ask for help and post your question on how to use XnView Classic.

Moderators: helmut, XnTriq, xnview

Post Reply
Greg Art
Posts: 2
Joined: Thu Nov 10, 2016 10:06 pm

How To Add Borders

Post by Greg Art »

Hello:
I love using Xnview. Awesome software.

I am enrolled in a Technology class that is requiring me to add borders to my photos. Can that be done in Xnview?

Thanks :D
cday
XnThusiast
Posts: 4397
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: How To Add Borders

Post by cday »

Greg Art wrote:I am enrolled in a Technology class that is requiring me to add borders to my photos. Can that be done in Xnview?
The only way I can see to add a border using XnView software, surprisingly, is to use XnConvert (or Tools > Batch convert... in XnView MP) with the action Canvas resize and the Relative check box selected, then experiment with the settings according to whether you wish the border to be defined in pixels or as a percentage of the image dimensions, and select the Background colour to the desired border colour. Batch convert can be used on a single image if necessary...

Or am I missing something?
User avatar
helmut
Posts: 8704
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Re: How To Add Borders

Post by helmut »

EDIT: cday was a bit quicker than me. ;-)

Simple border - Canvas resize - Manual
For adding a simple, rectangular border you resize the canvas of your image. When resizing, you use the colour of your choice as border.

1. Open image
2. Image > Canvas size
3. In "Screen size" panel choose "Pixels" as unit.
4. Uncheck "Keep ratio" (because you want the same thickness for your border in all directions)
5. In "Screen size" panel increase Width and Height. If you want your border 20 pixels thick, you add 20 pixels to Width and Height.
6. For "Image position" please choose "Center"
7. Choose a background colour. The border will have the chosen background color.
8. Press "OK" to perform the canvas resize.

By repeating the above steps with different colours you can make the border look quite interesting.

Simple border - Canvas resize - Batch
Even simpler than the above manual steps is creating a border using XnView's batch conversion. Again, the "Canvas resize" is the transformation to add the border. The good thing in the batch creation is that you can specify delta values, i.e. you don't have to calculate the new width but let XnView calculate it.

1. In XnView browser, select one or several images that you want to add a border
2. In "Output" panel specify "$transformed" as output directory. This will force XnView to save the results of the batch processing in a subfolder "transformed" of the current folder.
3. Select "Tools > Batch Processing..."
4. In "Transformations" tab add "Image > Canvas resize"
5. In "Parameters" panel specify the width and height of your border either in pixel or percent. Please check "Use above values as size deltas" and make sure that position is "Center". Last not least choose the background colour.
6. Repeat steps 3 and 4 if you want to create a multi-coloured border.
7. Save your script for later reusage by using "Save...".
8. Press "Go" to start the batch processing.

Original:
1156069538516-320x240.png
1156069538516-320x240.png (40.34 KiB) Viewed 3758 times
Result:
1156069538516-320x240-border.jpg
1156069538516-320x240-border.jpg (15.88 KiB) Viewed 3758 times
That's the contents of the .xbs file which created the above border:

Code: Select all

canvas( 0 #10 #10 4 255 128 0 0 )
canvas( 0 #10 #10 4 128 64 0 0 )
canvas( 0 #10 #10 4 64 0 0 0 )
settings( 1 0 0 0 0 0 0 )
output_path( $\transformed )
output( jpeg 80 0 0 0 0 0 1 0 0 0 1 )
More sophisticated borders
For adding a more complicate and perhaps more appealing border, you can use PhotoMasque and/or one of the Adobe 8BF plugins. See related topic:
- New Addon "PhotoMasque" for 1.92
- Nouvelle bordure
- Integrating Adobe filters
User avatar
XnTriq
Moderator & Librarian
Posts: 6512
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: How To Add Borders

Post by XnTriq »

Translucent 3D border (example):
  • Filter » Effects... » Effects
  • Tools » Batch Processing... » Transformations » Misc.
Greg Art
Posts: 2
Joined: Thu Nov 10, 2016 10:06 pm

Re: How To Add Borders

Post by Greg Art »

Thank you for your help. :0)
Post Reply