Jump to content
Paint.NET 5.1 is now available! ×

Recommended Posts

Posted

Hi, I'm trying to add borders to various items inside an image (all either squares or rectangles--very simple, no weird or funky shapes). The background is either dark gray or black, and I'm wanting to add a simple, 1-pixel thick border around each rectangle.

 

It's so super simple what I want to do, but I can't figure out how to do it. Google was no help either. Can anyone tell me how? (Also, no plug-ins please. I want to do this natively in the system.)

Posted
8 minutes ago, TheRewster said:

Also, no plug-ins please. I want to do this natively in the system.


Why are you imposing this restriction?

Using plugins is not cheating in any way.

@Rick Brewster concluded years ago that he would not have the time to provide all the functionality that people want 'natively' in Paint.NET. Instead, he put effort in to devising a plugin mechanism and has progressively enhanced its power with each major Paint.NET release. Thus, plugins have become an intrinsic part of Paint.NET's overall functionality.

Posted

Sorry, I didn't mean for my post to be so sharply anti-plugin. I should've worded it as, I'd prefer a native solution rather than having to download (yet another) plugin.

 

At any rate, I've hit upon a solution! For anyone with this issue in the future, what I did was--because my rectangular images-within-an-image were on a higher layer, I went down to the bottom layer, drew a rectangle on top of (or rather underneath) one that was one pixel thicker. Then I colored it in, and because it was on the lower layer, it came out looking like a border. I think it works pretty well as a workaround.

 

Anyway, thanks all!

Posted
6 hours ago, TheRewster said:

I'd prefer a native solution rather than having to download (yet another) plugin.

If you haven't got an Outline plugin, you're doing it hard.

 

outline.png

 

  • Upvote 1
Posted

Here's a kind of kludgy trick that seems to work, and is a bit more automatic. It assumes that the rectangles are on a transparent background, as yours seem to be.

 

  • Duplicate the top layer.
  • Recolor the rectangles to the border color. The Recolor Tool can be used for this.
  • Run Effects>Distort>Morphology. Set the Mode to Dilate, and the Width and Height to 3.
  • Move the layer down.
  • Merge the layers.

Why Morphology with a width and height of 3 expands a rectangle by 1 pixel in each direction, I can't say. But it always worked with the rectangles I tried.

 

Another (perhaps better) way to recolor the border rectangles is:

  • Set the Foreground Color to the desired color.
  • Use the Magic Wand to select the rectangle.
  • Use Edit>Fill Selection to recolor.

 

This can be done before or after expanding the rectangle with Morphology.

It might seem like the Paint Bucket could be used to recolor, but it bleeds the color half a pixel outside the rectangle.

UPDATE: The Paint Bucket can be used if antialiasing is disabled. I always hesitate to disable it, because I tend to forget to re-enable it when I'm done.

 

To recolor a bunch of objects the same color:

  • Set the Foreground Color to the desired color.
  • Use the Magic Wand to select the transparent background.
  • Invert the selection.
  • Use Edit>Fill Selection to recolor.

 

None of this is guaranteed, but it appeared to work when I tried it.

  • Like 1
Posted

Isn't the simplest solution, for rectangles and other geometric borders is just to use the draw tool Shapes > drop down option: Draw Shape Outline? That is not a plugin is it? There is a Shapes plugin expansion pack I think but the basic rectangle, square, oval, circle, triangle, polygons etc are surely standard drawing tools aren't they?     

 

Create a transparent layer and it likely won't matter where it is put in the layer pack that makes up the image. The width of the border can be adjusted to whatever is wanted using the adjacent Brush width tool.  

IHaveNoName.png

Posted
2 hours ago, IHaveNoName said:

Isn't the simplest solution, for rectangles and other geometric borders is just to use the draw tool Shapes > drop down option: Draw Shape Outline?

This works if the shapes do not overlap. In my image posted above, you'd get borders crossing the black middle. 

  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...