I'm not entirely sure what you're trying to achieve. Is the black-colored area in your example image supposed to be where the gradient would be? So there'd be gradient going from the outer edge of the area to it's inner edge?
Lately I've been messing around with GIMP, trying out new techniques as I come across them. Anyways, I'm probably just overlooking this feature, but is there a way in which I can do a 'shape based' gradient fill that plateus at a certain value and shape. Another way of wording it would be; can GIMP blend between 2 different coloured shapes (one atop the other) resulting in a gradient between the two?
Here is an example of what I mean. Just a very simple image with one shape on top of another.
Test001l.bmp
I've had a look at the 'interpolate' function of Inksacpe, but it requires each shape to have the same number of nodes and results in intermediate steps being smaller than the final image.
Anyways, thanks in advance.
Last edited by Thurlor; 05-07-2011 at 11:05 PM.
I'm not entirely sure what you're trying to achieve. Is the black-colored area in your example image supposed to be where the gradient would be? So there'd be gradient going from the outer edge of the area to it's inner edge?
- Member of The Campaign Builder's Guild
- My tutorials: How to make a roll of parchment graphic in GIMP
I make use of Wag's mountain brushes.
I don't think there's any easy way to do this in GIMP. There are ways (blurs, bevels) to create a black to white gradient to surround the inner area, but these would all result in the gradient being of equal thickness in all directions. That is, it would match the shape of the inner edge but not the outer one.
Although perhaps you could create two gradient masks, one based on the inner edge and the other one on the outer edge, and combine them by setting blend mode to multiply.
- Member of The Campaign Builder's Guild
- My tutorials: How to make a roll of parchment graphic in GIMP
I make use of Wag's mountain brushes.
I toyed a bit with that example pic and came up with this method for creating something like the effect you're after. Unfortunately the shapes of the inner and outer edges of the gradient zone are not preserved 100% accurately, but you do get a fait approximation of them.
First, you'll need to create two layers, one for working on the inner edge of the gradient, and another for working on the outer edge. Notice how I've inverted the black & white for these:
outer-1.pnginner-1.png
Let's edit the layer that contains only the inner shape first. Select the WHITE area and apply a Gaussian Blur (I used 120 pixel width) on it:
inner-2.png
This will create a gradient that smoothly darkes around the inner edge, yet maintains it's shape. Note, however, that the gradient only goes from white to gray, NOT white to black.
To fix this issue, make copies of the layer and set their blend modes to "multiply", then merge them. The result will be a single layer that contains a gradient from white to black, but without messing up the shape too much. You'll likely see a better quality result if instead of copying the same blurred layer, you create each layer manually and use a different Gaussian Blur width for each. Once you've merged the layers, invert the colors:
inner-3.png
- Member of The Campaign Builder's Guild
- My tutorials: How to make a roll of parchment graphic in GIMP
I make use of Wag's mountain brushes.
As for the outer edge, just use the same kind of process, but without inverting colors at the end:
outer-1.png
outer-2.png
outer-3.png
Now you should have two gradient layers, one for the inner edge and one for the outer edge. Place them so that the INNER shape gradient is above the OUTER one. Set this topmost layer's blend mode to "multiply" and set it's opacity to 50%. This should result in the final gradient band, limited by the designated shapes of the inner and outer edges, though not quite perfectly:
twolayers-multiply.png
You can merge the inner and outer gradient layers to get a single layer containing this final gradient, which can then be used for a mask.
I hope this advice was of any use to you
- Member of The Campaign Builder's Guild
- My tutorials: How to make a roll of parchment graphic in GIMP
I make use of Wag's mountain brushes.
@Ghostman
Thanks muchly for the detailed reply. It's definitely something I will have to try. I think I'm currently onto something using Wilbur as well, though I haven't had a chance to check it out properly yet.
Anyways, the use for all of this will be to set gradients below and above 'sea level' with upper and lower contour guides, whilst maintain the original shape of the landform. I can't think of a better way to explain what I'm after. If I'm going about this completely wrong and there is some easier way to accomplish my goal, I can't see it..
Last edited by Thurlor; 05-08-2011 at 07:57 PM.
There was a discussion on this back in '07
http://www.cartographersguild.com/sh...-contour-lines
Might be something there that helps.
-Rob A>
My tutorials: Using GIMP to Create an Artistic Regional Map ~ All My Tutorials
My GIMP Scripts: Rotating Brush ~ Gradient from Image ~ Mosaic Tile Helper ~ Random Density Map ~ Subterranean Map Prettier ~ Tapered Stroke Path ~ Random Rotate Floating Layer ~ Batch Image to Pattern ~ Better Seamless Tiles ~ Tile Shuffle ~ Scale Pattern ~ Grid of Guides ~ Fractalize path ~ Label Points
My Maps: Finished Maps ~ Challenge Entries ~ My Portfolio: www.cartocopia.com
Would this GIMP script be useful? To use it, you need to have your shape as the only non-alpha portion of the GIMP image. This script converts the image to a square, does a rectangular-to-polar conversion, and does a linear gradient down each column along the non-transparent portions of the drawing before going back to rectangular coordinates. It can also do contours, if you so desire. The script will show up in the Filters/SambrookJM menu under GIMP.
It's not perfect, but it could be a good starting point. It's not a fast script at all, so any ideas on how to speed things up would be greatly appreciated. I'd also like to know how you delete the selection-mask channel, since the ways I've tried haven't worked.
Hope this helps out somewhat...
I think I've had this Deja Vu before...
@sambrookjm: Thank you muchly for that. I'll be having a close look at it in the next few hours and I'll let you know how it works out.