Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
bucket fill right to the edge?
#1
Hi! I'm making a browser game, with simple graphics drawn in the GIMP. and hit a problem with the GIMP fill tool.

Imagine I have a black circle (in outline, on white). I use the fill tool to fill the circle with red. When the fill tool finds an off-white pixel, it either fills it totally or not at all, depending on the threshold setting. So the red either eats into the outline (only the purest black pixels remain, looking narrow and jagged) or leaves a white-ish outline.

Is there any way to fill the circle so that off-white pixels are tinted instead or replaced? So that the red fades into black? I know the best solution is not to create the image that way in the first place. But I am editing existing images. I wish I could just click "fill" and have a nice result. Any suggestions?
Reply
#2
Just for reference, I found a solution: Krita has a more advanced fill tool. Don't worry, I still use the Gimp for everything else Smile
Reply
#3
Just in case tolworthy comes back.

There is a way to do this in Gimp.

If you have a black circle on a white background there are anti-aliasing pixels between the black and white. These are shades of grey. It is important to preserve these anti-aliasing pixels.

Summary of method:
1) Use Fuzzy select to select the white inside the circle.
2) Grow the selection by 1 or 2 pixels
3) Create a new transparent layer below your image.
4) On this new layer, bucket fill the selection with red
5) Select the top layer again
6) Colours > Colour to Alpha and accept the default white

Colour to Alpha preserves the anti-aliasing pixels.
Reply
#4
(12-08-2018, 08:04 AM)Blighty Wrote: 6) Colours > Colour to Alpha and accept the default white

A variation of this step is to set the b/w layer (aka lineart) to 'Multiply'. 
In comparison to Colour-To-Alpha its non-destructive.
Reply
#5
(12-08-2018, 08:04 AM)Blighty Wrote: Just in case tolworthy comes back.

There is a way to do this in Gimp.

If you have a black circle on a white background there are anti-aliasing pixels between the black and white. These are shades of grey. It is important to preserve these anti-aliasing pixels.

Summary of method:
1) Use Fuzzy select to select the white inside the circle.
2) Grow the selection by 1 or 2 pixels
3) Create a new transparent layer below your image.
4) On this new layer, bucket fill the selection with red
5) Select the top layer again
6) Colours > Colour to Alpha and accept the default white

Colour to Alpha preserves the anti-aliasing pixels.

That's great to know! Many thanks!
Reply
#6
1) remove the current color with color-to-alpha. If necessary, make a fuzzy selection on the background and and grow it by one or two pixels so that it covers the edge pixels. Off-white pixels will be partially transparent
2) bucket-fill with the new color (using the same selection) using the bucket-fill tool in Behind mode. This will complement the partiall transparent pixels with the new color

The Gimp fill tool is advanced enough once you have read the doc Smile
Reply


Forum Jump: