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
  Changing a silhouette to line art Tropdoug 7 122 Oct 13, 2014 11:28
Last Post: ofnuts
  Can't find line tool? FluffyMuffins230 8 159 Oct 1, 2014 16:24
Last Post: FluffyMuffins230
  How to paint with single pixel? Teekin 4 116 Sep 28, 2014 16:00
Last Post: rich2005
  Lithophane/line image djh256 4 199 Sep 16, 2014 15:12
Last Post: ofnuts
  How Do I Add One Pixel Dots to a TGA Image? jagdpanther 3 203 Aug 17, 2014 01:12
Last Post: fluffybunny2

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS