Adding a border around an image

Asked by markadoi84

I want to put a black border around an image (a standard rectangle shaped), however using the Object > Fill and Stroke > Stroke Paint (selecting Flat Colour) does not seem to work for me for some reason. Is this the correct tool, and if so is there a reason why it isn't working? Otherwise, I hope somebody can tell me how I can do this.

Thanks,
Mark

Question information

Language:
English Edit question
Status:
Solved
For:
Inkscape Edit question
Assignee:
No assignee Edit question
Solved by:
su_v
Solved:
Last query:
Last reply:
Revision history for this message
Best su_v (suv-lp) said :
#1

You cannot apply style attributes like fill/stroke to imported bitmaps.

Instead use the 'Rectangle tool' to draw a rectangle on top of the (imported) bitmap, then change the style of the rectangle as you need it (no fill, but stroke paint and style).

If the thick stroke overlaps the picture, change the stack order of the rectangle by selecting it and using the command 'Object > Lower' to 'move' it below the image.

Then group the picture and the rectangle frame if you want it to behave as one object (when selecting, moving, scaling …)

hth, ~suv

Revision history for this message
markadoi84 (mark-hughes) said :
#2

Suv, thank you very much - I decided to do that anyway, but I think I must have a mild form of OCD because it just didn't seem right - and I thought you must be able to do that for imported bitmaps. Thanks for your reply, much appreciated.

Regards,
Mark

Revision history for this message
su_v (suv-lp) said :
#3

More sophisticated 'frames' for images can be achieved by clipping the image, more information here:
<http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Clip.html> and
<http://en.flossmanuals.net/Inkscape/ClipAndMask>

hth, ~suv

Revision history for this message
su_v (suv-lp) said :
#4

Here's a related 'Wishlist' bug report:
<https://bugs.launchpad.net/inkscape/+bug/277967> “Wishlist item: Putting a margin around an entire image”
Looks like 'adding style attributes to images' will be possible once Inkscape supports CSS style.

Revision history for this message
markadoi84 (mark-hughes) said :
#5

Thanks for all the info Suv, very useful indeed. Just starting out with the programme and it's very useful to get these tips and advice. So, thanks very much once again.

All the best,
Mark

Revision history for this message
pbhj (pbhj) said :
#6

I find it handy to use the Edit > Paste Size facility to copy the image size and paste it as the size of a newly created rectangle. Then you can lock the ratio (padlock on the toolbar) for the rectangle and resize as needed. FWIW.