1

I'm trying to test this little graphics program I wrote, and I want to be able to draw configurations of solid colored shapes in Gimp, and then import them into my program for testing. It's important that the shapes be absolutely solid colored, and not have any weird non-uniformities in them.

A complication I'm having by trying to make these images in Gimp is that even when I uncheck "feather boundary" and change the Edit > Stroke Style width to 0 px, I still get a boundary around the ellipse, e.g. the picture below. So in the picture below, I took the exported ellipse image from Gimp, then did an MS paint fill of black on the interior and exterior of the ellipse, and I get the observed boundary on the right.

I'd appreciate any thoughts for how to totally prevent this from happening, so that there's absolutely no boundary or transition region at all.

Thanks.

[in this picture]

3

GIMP has anti-aliased the edge. That's about 1..2 pixel wide zone which is partially transparent (if you have otherwise transparent layer) or partially mixed with the background. Without antialiasing edges look jagged.

You have several methods to make non-antialised shapes in GIMP:

  1. paint with a hard edged brush (Maybe not especially good option if you need an ellipse).

  2. make a selection, set in the selection tool options antialiasing = OFF. Fill the selection with the paint bucket with tool option fill whole selection =ON.

  3. Draw a path. Convert the path to selection. Apply Select > Sharpen. Fill the selection with Paint Bucket.

If you fill without sharpening the selection the edge will be like this:

enter image description here

Making the fill after sharpening the edge looks this:

enter image description here

2

Choose the Ellipse Select tool, and uncheck "Antialiasing" in the Tool Options.

Then when you make the ellipse and fill it (Edit > Fill with FG/BG colour), the colours will be solid. Note however that doing so will make the shape edges jagged, which is why antialising exists, to give the illusion of smoother edges.

Example

enter image description here

1

Looks like an XY problem. Gimp isn't Paint, and Gimp has layers. If you want to paint a red ellipse on a green background, you use two layers:

  • one where the ellipse is surrounded by transparency,
  • one completely filled a uniform color

So this;

enter image description here

Is actually this:

enter image description here

The background layer is masked off by the ellipse. On the rim of the ellipse, there are partially transparent pixels. These make the background color visually blend with the ellipse color to create smooth edges.

enter image description here

To change the background color, you just bucket fill the background layer with something else.

To change the ellipse color, you "alpha-lock" it and bucket-fill the layer. The alpha-lock preserves the opacity of the edge pixels:

enter image description here

So you can change both ellipse and background and still keep clean smooth edges:

enter image description here

Of course if you have several objects you use a single background and a layer per object (besides making color changes easy, this also lets you move them around):

enter image description here

enter image description here

Notice how well this handles the possible overlaps between objects...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.