Raphael et al. On Mon, May 08, 2000 at 08:36:01PM +0200, Raphael Quinet bashed: > I wrote "make a selection that is 1 pixel smaller" instead of "use > Select->Shrink" because shrinking the selection does not work well > in this case. If you are trying to make a perfect 1-pixel-thick > circle (with anti-aliasing), you really have to make a second > selection instead of trying to shrink the existing one. The > differences between shrinking the selection and making a new one are > not very big, but they are visible. > > I did several experiments in order to find the best way to create a > perfect 1-pixel circle. That's how I eventually came up with this > tip. I encourage you to do the same if you want to understand the > problems: > > - Create a new image (256x256). > - Choose the 1-pixel brush. > - In one corner of the image, select a 100x100 circle, switch to the > Pen and use Edit-Stroke: you get a 1-pixel circle, but without > anti-aliasing. The average thickness is fine, though. > - In another corner, do the same with Edit->Stroke but use the Brush > instead of the Pen: you get a 2-pixels circle (much too thick), and > the anti-aliasing is not even good. > - In a third corner, select a 100x100 circle, fill it with black, > then select a 98x98 circle with the same center and clear it: you > get a 1-pixel circle that looks perfect. > - In the fourth corner, select a 100x100 circle, fill it with black, > use Select->Shrink and then clear: you get something that is a bit > thicker than the previous one (like 1.4 pixels), especially in the > areas that have a tangent at +/- 45 degrees. The parts of the > circle that are almost vertical or horizontal seem to be a bit > thinner than the other parts of the circle. In the fifth corner (!), I selected a circle, filled it with black, then went into quickmask. I did a Gaussian blur of 2 pixels, fiddled with the levels to put some sharp contrast back in somewhere on the 'bright' end of things, (207,1.00,247) then went out of quickmask and did a clear. It was about as consistent as your third corner though a tiny bit darker. The nifty thing about doing it with the blur+levels approach is that it allows you to get fine-grained "fractional pixel" thickness on your lines (if you are very patient with it). It also more-or-less retains the ability to work with arbitrary selections rather than just ellipses. > If you compare the results, you will see that the method involving two > selections gives the best results. It would be nice if there was an > easier way to do that with the Gimp, but I haven't found any... A short script that does selection->channel, blur, levels as I describe above might do the trick. It's just a matter of distilling the procedure into something that will allow the user to specify grow/shrink and a number of pixels. In the long run, perhaps grow+shrink should just be changed to use something more Gaussian. Tom -- -- Tom Rathborne tomr@xxxxxxxxxxxx http://www.aceldama.com/~tomr/ -- "We promise according to our hopes, and perform according to our fears." -- -- Francois, Duc de la Rochefoucauld