Problem: How to take PNG images and make a
border with a consistent thickness and placement.
Like most problems, there are a number of possible solutions.
For example, with InkScape, import the PNG image, create a
slightly oversized rectangle, move that rectangle behind the
image, set color to taste, resize the document to include the
rectangle, and export the new image.
Right. Trying to get that rectangle just the right size is
more fiddling than I like to do. There must be an
easier way
And there is!
Solution: Use Inkscape to do the decorating.
Open Inkscape.
Import the PNG file, so your picture is on the art board.
Click on the Paint Bucket tool icon:
Across the top of the InkScape window, just below the line of icons, is the
settings for the Paint Bucket tool. Set the contents of each of the
items in this bar to the values shown here:
Fill by:
Alpha
Threshold:
0
Grow/shrink by:
6.00 pt
Close Gaps:
None
With the Paint Bucket Tool still selected, click inside the picture. The
tool will create a path around the picture. Note that the corners of the
path are rounded slightly; I leave this alone.
(If you just can't stand rounded corners, try using the path
editing tool. The easiest way I found is:
Change four of the control points to corner points
Remove the excess control points
Move those four points to the corners
Fiddle with the handles to make the lines square
You may find it easier to define a new rectangle over the path, and
then delete the paint bucket generated path.
Now aren't you sorry you asked?)
Navigate to InkScape → Object menu → Layers and Objects item
Click on the object “Path1” This selects the newly-created path
Navigate to InkScape → Object menu → Fill And Stroke item
Under the Fill tab, click the “X” (no paint)
Under the Stroke paint tab, select the square with solid color; choose the color.
NOTE: you can specify an RGBA value (red blue green alpha).
Under the Stroke style tab, set the width to 6 pt
Navigate to InkScape → Object menu → Layers and Objects item
Click on "Layer 1". (If there is no such layer, use Ctrl-A to select all the objects.)
Navigate to InkScape → File menu → Document Properties item
Click the page icon next to “Resize to content”
Navigate to InkScape → File menu → Export item
Select the target location for the file using the folder icon, or by typing the name
Press the Export button.
Image is now nicely bordered, with a 6-point width.
For other thicknesses of the boarder, change the "Grow/Shrink by" values,
and the stroke width of the path.