Post Reply 

1 pixel wide line with feathering

Jun 12, 2012, 14:06 (This post was last modified: Jun 12, 2012 15:01 by spiderplant0.)
Post: #1
1 pixel wide line with feathering
I'm trying to create 1 pixel wide borders for some web buttons. I've tried to use the GIMP path tool to do this but I can't figure out how to get it looking right. See attached image.

1 - copied from a button I found on a web-page. This is what I want - single pixel horizontal and vertical lines with feathering on the curved bits.

2 - path that I used to generate the images on the right.

3 - 'Stroke Path' with 1px brush size & no antialiasing. Corners are not smooth.

4 - 'Stroke Path' with 1px brush size & anti-aliasing. Straight lines are too fuzzy as they are 2 pixel wide rather than 1.

Is there a way to do this with the path tool or any other way with the GIMP?

   
Find all posts by this user
Quote this message in a reply
Jun 12, 2012, 16:11
Post: #2
RE: 1 pixel wide line with feathering
(Jun 12, 2012 14:06)spiderplant0 Wrote:  I'm trying to create 1 pixel wide borders for some web buttons. I've tried to use the GIMP path tool to do this but I can't figure out how to get it looking right. See attached image.

1 - copied from a button I found on a web-page. This is what I want - single pixel horizontal and vertical lines with feathering on the curved bits.

2 - path that I used to generate the images on the right.

3 - 'Stroke Path' with 1px brush size & no antialiasing. Corners are not smooth.

4 - 'Stroke Path' with 1px brush size & anti-aliasing. Straight lines are too fuzzy as they are 2 pixel wide rather than 1.

Is there a way to do this with the path tool or any other way with the GIMP?
Yes, but your path has to be on half-pixel coordinates. For the image below, I use the rounded-rectangle path generator from shape-path script with top/left/right/bottom set to 24.5/24.5/74.5/74.5 and corner radiuses of 5. Then Edit/stroke with a 1px line;

   

Of course stroking with 3 pixels is also sharp but stroking with 2 pixels is blurry (but is OK if the path is on full-pixel coordinates)

[Image: 2Tvo0.png]

Visit this user's website Find all posts by this user
Quote this message in a reply
Jun 14, 2012, 10:49
Post: #3
RE: 1 pixel wide line with feathering
Thanks. Thats just what I was looking for. One other thing though, when manually creating a path, is there a way in GIMP to align or snap to 1/2 pixels? The grid doesnt allow 1/2 pixel resolution. One idea I came across was to scale the image up by x2, align to 1px grid, then scale down again. Dont know if repeated scaling up and down will start to smear pixels in other parts of the image though. Do you know if there any other more direct methods of aligning to 0.5px? I did a search for path shrink script but couldnt find anything.
Find all posts by this user
Quote this message in a reply
Jun 14, 2012, 12:00
Post: #4
RE: 1 pixel wide line with feathering
I have a path-shift script, among other things. The whole collection is there:

http://gimp-path-tools.sourceforge.net/index.shtml

Have fun.

[Image: 2Tvo0.png]

Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Cleaning up a low rez [coloring book] line drawing. nyxythepixy 2 80 Apr 12, 2014 22:24
Last Post: nyxythepixy
  Color replacement from the command line blue1 1 115 Feb 17, 2014 23:58
Last Post: ofnuts
  Line Script 2Old 8 207 Feb 6, 2014 21:51
Last Post: ofnuts
  Blending a harsh line thardenbrook 4 249 Dec 30, 2013 21:46
Last Post: thardenbrook
  Can't manage to make a 1 pixel brush guizadin 5 232 Dec 12, 2013 06:39
Last Post: terryow100

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS