RSS/Atom feed Twitter
Site is read-only, email is disabled

The best way to make a rounded corner box with a border

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

11 of 13 messages available
Toggle history

Please log in to manage your subscriptions.

The best way to make a rounded corner box with a border Deniz Dogan 02 Jun 10:33
  The best way to make a rounded corner box with a border Branko Vukelic 02 Jun 11:16
   The best way to make a rounded corner box with a border Branko Vukelic 02 Jun 11:20
    The best way to make a rounded corner box with a border Deniz Dogan 02 Jun 11:38
F0D1C2B2-23A5-4EF3-BBDB-427... 07 Oct 20:21
  The best way to make a rounded corner box with a border Branko Vukelic 02 Jun 12:56
   The best way to make a rounded corner box with a border Deniz Dogan 02 Jun 14:18
    The best way to make a rounded corner box with a border Branko Vukelic 02 Jun 14:22
4729C1B2-643E-4C45-AA58-5FC... 07 Oct 20:21
  The best way to make a rounded corner box with a border Deniz Dogan 02 Jun 14:42
   The best way to make a rounded corner box with a border Rob Antonishen 02 Jun 17:22
    The best way to make a rounded corner box with a border Sven Neumann 02 Jun 21:18
     The best way to make a rounded corner box with a border Rob Antonishen 02 Jun 21:50
Deniz Dogan
2010-06-02 10:33:49 UTC (almost 14 years ago)

The best way to make a rounded corner box with a border

Lately, I've been thinking whether the way I make bordered boxes with rounded corners is the "best" one or if I'm missing something essential.

The way I do it is: 1. Use the rounded rectangle selection to make a rectangle. 2. Fill it with the color I want the border to have. 3. Shrink the selection by as many pixels as I want the border to take up. 4. Fill the new selection with the box background color.

What ways are there to accomplish it? Are there any cons to using the method I use? I'm asking because I recently wrote a little Script-Fu for doing just this, since I do it so often.

Branko Vukelic
2010-06-02 11:16:37 UTC (almost 14 years ago)

The best way to make a rounded corner box with a border

On Wed, Jun 2, 2010 at 10:33 AM, Deniz Dogan wrote:

The way I do it is:
1. Use the rounded rectangle selection to make a rectangle.

2. Select -> Border...
3. Fill new selection with color
4. Enjoy. :)

Branko Vukelic
2010-06-02 11:20:25 UTC (almost 14 years ago)

The best way to make a rounded corner box with a border

On Wed, Jun 2, 2010 at 11:16 AM, Branko Vukelic wrote:

On Wed, Jun 2, 2010 at 10:33 AM, Deniz Dogan wrote:

The way I do it is:
1. Use the rounded rectangle selection to make a rectangle.

Sorry, missed one step:

1a: Fill the selection with color.

2. Select -> Border...
3. Fill new selection with color
4. Enjoy. :)

+ it might be entirely possible to do a script that does this automatically. It could take border with from the user, and use FG/BG color to fill the selections.

Deniz Dogan
2010-06-02 11:38:04 UTC (almost 14 years ago)

The best way to make a rounded corner box with a border

2010/6/2 Branko Vukelic :

On Wed, Jun 2, 2010 at 11:16 AM, Branko Vukelic wrote:

On Wed, Jun 2, 2010 at 10:33 AM, Deniz Dogan wrote:

The way I do it is:
1. Use the rounded rectangle selection to make a rectangle.

Sorry, missed one step:

1a: Fill the selection with color.

2. Select -> Border...
3. Fill new selection with color
4. Enjoy. :)

+ it might be entirely possible to do a script that does this automatically. It could take border with from the user, and use FG/BG color to fill the selections.

-- Branko Vukeli?

bg.branko@gmail.com studio@brankovukelic.com

Check out my blog: http://www.brankovukelic.com/ Check out my portfolio: http://www.flickr.com/photos/foxbunny/ Registered Linux user #438078 (http://counter.li.org/) I hang out on identi.ca: http://identi.ca/foxbunny

Gimp Brushmakers Guild http://bit.ly/gbg-group

I used to try it "your way" before, but I always get jagged edges on the border when I try that.

This is what I get when I do a rounded rectangle with a 5 pixel corner radius, black background and white edge using your technique: http://pici.se/pictures/fWkVUUfxo.png This is what I get when I do it "my way": http://pici.se/pictures/xFAQhXVbC.png

Is there something I'm missing?

Branko Vukelic
2010-06-02 12:56:53 UTC (almost 14 years ago)

The best way to make a rounded corner box with a border

On Wed, Jun 2, 2010 at 12:48 PM, Cameron Gregory wrote:

In some cases there is also "out by one" problem.

Here is a patch for said issue (most noticeable when rounding is 100% (trying to make a pill)

http://blog.bloke.com/2010/05/patch-for-gimp-select-rounded-rectangle/

The most straightforward way to create a pixel-perfect rounded rectangle with border I can think of is to use Inkscape (http://www.inkscape.org/) and import the SVG into Gimp. You get perfect control over the rounding and border weight + the rasterization of the SVG eliminates the jaggedness.

Another way I can think of is to convert the rounded selection to path, stroke it to create the border. This produces acceptable results, but I've noticed some weird artifacts.

Deniz Dogan
2010-06-02 14:18:16 UTC (almost 14 years ago)

The best way to make a rounded corner box with a border

2010/6/2 Branko Vukelic :

On Wed, Jun 2, 2010 at 12:48 PM, Cameron Gregory wrote:

In some cases there is also "out by one" problem.

Here is a patch for said issue (most noticeable when rounding is 100% (trying to make a pill)

http://blog.bloke.com/2010/05/patch-for-gimp-select-rounded-rectangle/

The most straightforward way to create a pixel-perfect rounded rectangle with border I can think of is to use Inkscape (http://www.inkscape.org/) and import the SVG into Gimp. You get perfect control over the rounding and border weight + the rasterization of the SVG eliminates the jaggedness.

Another way I can think of is to convert the rounded selection to path, stroke it to create the border. This produces acceptable results, but I've noticed some weird artifacts.

It's too bad one has to resort to using other programs for pixel perfect borders (as if there ever was such a thing). That means it's impossible to write a Script-Fu for it (unless you are *really* ambitious) and also that you can't use GIMP's gradients to fill the border or the background of the box.

A sad day this is.

Branko Vukelic
2010-06-02 14:22:13 UTC (almost 14 years ago)

The best way to make a rounded corner box with a border

On Wed, Jun 2, 2010 at 2:18 PM, Deniz Dogan wrote:

It's too bad one has to resort to using other programs for pixel perfect borders (as if there ever was such a thing). That means it's impossible to write a Script-Fu for it (unless you are *really* ambitious) and also that you can't use GIMP's gradients to fill the border or the background of the box.

A sad day this is.

Not as long as you can do it. :) Most FLOSS workflows do require a certain amount of dedication, imo.

Deniz Dogan
2010-06-02 14:42:21 UTC (almost 14 years ago)

The best way to make a rounded corner box with a border

2010/6/2 Cameron Gregory :

you can still fill the border with gradients. same way .. make a border. fill with gradient, make an inner border and bill with BG...

similar for gradient on the inside

cameron

Sure, I'm just saying I can't use GIMP's gradients. I have to use the ones in Inkscape. :)

Rob Antonishen
2010-06-02 17:22:40 UTC (almost 14 years ago)

The best way to make a rounded corner box with a border

Sure, I'm just saying I can't use GIMP's gradients. I have to use the ones in Inkscape. :)

BTW- Inkscape can use gimp gradients (they are the same format).

Back to the main question, the process for stroking any selection is to convert it to a path, then stroke that.

It gives results that are always better.

I tried scripting it, but couldn't figure out how to open the stroke path dialog (or advanced stroke path dialog) from a script.

It would be nice if gimps stroke selection did that internally rather than thresholding the selection and "stroking" along that.

-Rob A.

Sven Neumann
2010-06-02 21:18:04 UTC (almost 14 years ago)

The best way to make a rounded corner box with a border

On Wed, 2010-06-02 at 11:22 -0400, Rob Antonishen wrote:

Sure, I'm just saying I can't use GIMP's gradients. I have to use the ones in Inkscape. :)

BTW- Inkscape can use gimp gradients (they are the same format).

Are they?

It also works the other way around: GIMP can use SVG gradients.

Sven

Rob Antonishen
2010-06-02 21:50:51 UTC (almost 14 years ago)

The best way to make a rounded corner box with a border

BTW- Inkscape can use gimp gradients (they are the same format).

Are they?

Maybe not the same format(?), but drag and drop a .ggr into the canvas and you can then use it in inkscape.

-Rob A>