Gimp-Forum.net
How to fill entire image from gradient outline - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: General questions (https://www.gimp-forum.net/Forum-General-questions)
+--- Thread: How to fill entire image from gradient outline (/Thread-How-to-fill-entire-image-from-gradient-outline)

Pages: 1 2


How to fill entire image from gradient outline - ahsaul - 11-02-2022

I have an outline from an image that is gradient and I'm trying to make the entire image (square) match the gradient. Is there a fairly easy way to accomplish this?


RE: How to fill entire image from gradient outline - rich2005 - 11-02-2022

You can make a gradient that follows those colours ? You can get close.

First make sure you have the palettes dock open. Windows -> Dockable Dialogues -> Palettes. There is a bit of right-click context menu required.

This screenshots of the procedure: top-to-bottom https://i.imgur.com/juOPzwu.jpg

1. Convert the RGB image to indexed 255 colours / dithering None
2. Right-click in Palettes dock and select Import Palette. In the dialogue choose Image.
3. That gives a new palette in the dock. Right-click on it and choose Palette to Gradient.
4. That gives a new gradient to try out.


RE: How to fill entire image from gradient outline - tmanni - 11-02-2022

the easiest way :
1) set your background color with the Color Picker tool by picking the most bottom green/yellow color ; you should obtain the color #94ff01
2) set your foreground color with the Color Picker tool by picking the most top centered blue color ; you should obtain the color #00b6ff
3) use the Gradient tool to create vertical linear gradient across the image:
- gradient Foreground to Background (RGB)
- shape : Linear


RE: How to fill entire image from gradient outline - Krikor - 11-02-2022

With the Color Picker Tool you select extreme colors.
With the Fuzzy Select Tool you select the area to be filled.
With the Gradient Tool, you choose the shape, possibly Linear or Conical Sym.

Preferably apply the gradient to a layer below the original.
[attachment=8954]


RE: How to fill entire image from gradient outline - MichaJo - 11-02-2022

And last but not least if you have G'MIC installed:
Filters -> G'MIC-Qt...Repair -> Solidify


RE: How to fill entire image from gradient outline - Ofnuts - 11-02-2022

It is going to be difficult to get the perfect gradient, but you can get very close.

First make a selection that covers your outline and what is inside:
  • With the fuzzy select tool, select the inside the the shape
  • Select grow by a 3 pixels, sol that your selection enters the outline
  • Layer > Transparency > Add to selection to add the shape to the selection
Color-pick the bottom color (in left or right corners, along the edge) as the background and the top color (as color to the edge as possible) as the foreground.

Add a transparent  layer, a drag it below the outline layer n the layers list

Set the gradient to FG to BG (RGB)

To make sure to create a clean vertical gradient from edge to edge you can 1) add a vertical guide and 2) set View > Snap to canvas edges


Make sure the active layer is the empty layer at the bottom. Start the gradient tool and drag the gradient, top to bottom. Then look at the outline, there will  be places where the difference between the outline and the gradient is noticeable:

[attachment=8955]

Then by clicking in the middle of the gradient line, you will make the gradient midpoint appear,

[attachment=8956]

And you can move this midpoint up and down to adjust the gradient, which you do while watching the outline, to minimize the difference.

When done, just keep your new layer and discard/hide the initial outline.


RE: How to fill entire image from gradient outline - PixLab - 11-03-2022

It's very easy to get your gradient filled (3 clicks only)

Go to Filters ➤ Blur ➤ Linear Motion Blur, Angle at 0 (to be sure it's horizontal), Length > full (1000)
Do it 2 times because your image is quite big (Tip: just do a Ctrl+F for the second time, Ctrl+F will repeat the last used filter (Linear Motion Blur) without showing the filter's window)

[attachment=8957]

Then go to Layer ➤ Transparency ➤ Threshold Alpha Value at 0 (completely opaque)
You're done Wink

[attachment=8960]

Perfect gradient, you cannot see a difference between the top (original) and the bottom layer (gradient filled)

[attachment=8961]


RE: How to fill entire image from gradient outline - Ofnuts - 11-03-2022

(11-03-2022, 06:01 AM)PixLab Wrote: Perfect gradient, you cannot see a difference between the top (original) and the bottom layer (gradient filled)

*cough* Don't tell me you don't see the bands in your output, which I also get if I reproduce your method? Your method, while clever, will always produce bands because you get the very same value for all pixels in a horizontal strip, and you cannot absolutely assure that the value will always change in the direction from one line of pixels to the next. In fact it would work better if you use a tiny angle that would introduce some vertical blur.

A slightly better method it to use Gaussian blur, with a large X (1000) and a tiny Y (1). Gaussian blur is also a lot faster than motion blur.


RE: How to fill entire image from gradient outline - denzjos - 11-03-2022

I little time consuming but I tried this :
- made a layer copy from the original
- put a white layer under the copied layer
- made a new layer 'New from Visible'
- select the inside of the drawing with the 'Fuzzy Select Tool'
- 'Select / Grow ' (20 pixels)
- 'Select / To Path' 
- 'Select / None'
- make a new copy from the original and work on this layer (an set the other layers not visible) 
- 'Filters / Blur / Median Blur (Neighborhood Circle, Radius 30, Percentile 50, Alpha percentile 100)
- 'Select / From Path'
- delete the inside of the drawing
- 'Select / None'
Then until the square is filled, repeat :
- 'Filters / Blur / Median Blur (Neighborhood Circle, Radius 30, Percentile 50, Alpha percentile 100)
- 'Select / From Path'
- delete the inside of the drawing
- 'Select / None'
Merge the result with the original layer
Result : 
[attachment=8966]


RE: How to fill entire image from gradient outline - PixLab - 11-03-2022

(11-03-2022, 09:26 AM)Ofnuts Wrote:
(11-03-2022, 06:01 AM)PixLab Wrote: Perfect gradient, you cannot see a difference between the top (original) and the bottom layer (gradient filled)

*cough* Don't tell me you don't see the bands in your output, which I also get if I reproduce your method? Your method, while clever, will always produce bands because you get the very same value for all pixels in a horizontal strip, and you cannot absolutely assure that the value will always change in the direction from one line of pixels to the next. In fact it would work better if you use a tiny angle that would introduce some vertical blur.

A slightly better method it to use Gaussian blur, with a large X (1000) and a tiny Y (1). Gaussian blur is also a lot faster than motion blur.

Instead of only watching degraded JPG, why you did not try it?
BTW I did tried the gaussian blur, it's not better, yeah... before to post I try things! although a bit of gaussian blur AFTER the Motion blur is quite nice.

Anyway, I'm fed-up of you, you are ALWAYS behind me, searching for that tiny pixel to discredit each and every single method I could propose, here, as well as on reddit, GC
While you're here I would like you to do one more thing ➤ DELETE my account in here on gimp-forum (keep the post maybe they can help people which are thinking not your way)