Add an alpha gradient to a pattern.
Add an alpha gradient to a pattern.
Is there a way to make a pattern fade way near the edges? The fill dialog makes it look like patterns and gradients are mutually exclusive, but I thought I'd ask whether anyone knows a way of applying a gradient alpha channel on top of a pattern. This might be beyond the scope of inkscape (although I'm not sure how to do it in gimp either: blending the alpha channels of two different images).
Re: Add an alpha gradient to a pattern.
Hi.
As far I've tested that can't be done.
However, if you really need to set opacity to a gradient you can put it into a separate layer. But I'm afraid I cannot help you add a proper alpha to the pattern.
As far I've tested that can't be done.
However, if you really need to set opacity to a gradient you can put it into a separate layer. But I'm afraid I cannot help you add a proper alpha to the pattern.
Re: Add an alpha gradient to a pattern.
There might be a filter that does this, sort of, but probably not exactly what you need. You might be able to use interpolation to fake a sort of feathering effect, if it was a solid colored object. But with a pattern fill, it wouldn't work. What about a mask? It wouldn't change the pattern fill, but instead, mask it.
Basics - Help menu > Tutorials
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Re: Add an alpha gradient to a pattern.
LiquidAsh wrote:Is there a way to make a pattern fade way near the edges? The fill dialog makes it look like patterns and gradients are mutually exclusive, but I thought I'd ask whether anyone knows a way of applying a gradient alpha channel on top of a pattern
I was able to do this quite easily, LA, is there a specific problem you are having that you could explain?
Have you tried to get what you want with tiled clones? These will accept gradients in the original and remain editable in the copies.
Off topic:
LiquidAsh wrote:although I'm not sure how to do it in gimp either: blending the alpha channels of two different images
are you familiar with layer masks? These are alpha channels for each layer in an image.
Last edited by druban on Thu Aug 16, 2012 6:36 pm, edited 2 times in total.
Your mind is what you think it is.
Re: Add an alpha gradient to a pattern.
I interpreted the question a bit differently to druban, so here's my suggestion. One of us is bound to have got the right idea
I would do this with a mask. You will have one object containing your pattern, and another (possibly a group) containing elements of black, white and grey to use as a mask. I chose the sand pattern (with a bit of a wink - it gets used in almost all our comic strips!), and then created a group of two rectangles, one black, and one white. The white one was blurred.
Then I made clones of my object and group, aligned them, and ensured that the group (mask) is on top. Select them both and then right-click > Set Mask.
You could do this with the originals rather than making clones, but by using clones it's easier to modify the originals and immediately see the effect, rather than having to release the mask then re-set it. Once you're happy with the effect you can re-do it with the originals if you want.
I've attached the SVG so you can download it and play around with the shape and fill of the top row to see the effect at the bottom.
I would do this with a mask. You will have one object containing your pattern, and another (possibly a group) containing elements of black, white and grey to use as a mask. I chose the sand pattern (with a bit of a wink - it gets used in almost all our comic strips!), and then created a group of two rectangles, one black, and one white. The white one was blurred.
Then I made clones of my object and group, aligned them, and ensured that the group (mask) is on top. Select them both and then right-click > Set Mask.
You could do this with the originals rather than making clones, but by using clones it's easier to modify the originals and immediately see the effect, rather than having to release the mask then re-set it. Once you're happy with the effect you can re-do it with the originals if you want.
I've attached the SVG so you can download it and play around with the shape and fill of the top row to see the effect at the bottom.
- Attachments
-
- pattern_and_mask.svg
- (110.46 KiB) Downloaded 270 times
-
- pattern_and_mask.png (112.38 KiB) Viewed 6582 times
Re: Add an alpha gradient to a pattern.
Yeah, I think Xav has interpreted the OP's request correctly, because now i notice that he said, "patterns and gradients are mutually exclusive..." which they are, because you can only specify one kind of fill for any object.
Off topic:
Incidentally, Xav, what is the purpose of the black rectangle in the mask group???Your mind is what you think it is.
Re: Add an alpha gradient to a pattern.
Yes, it sounds like Xav has nailed it. I've used masks quite a bit, but never with alphas. It sounds like this will work brilliantly. Thanks everyone!
Re: Add an alpha gradient to a pattern.
druban wrote:Off topic:Incidentally, Xav, what is the purpose of the black rectangle in the mask group???
You're right, it's not really needed. I've just got into a habit of drawing masks explicitly using white and black (and the greys in-between) for a couple of reasons:
1) I find it a lot easier to see a translucent white rectangle against a black one, than against the white background of the page
2) It mirrors the layer masks in The GIMP which uses greyscale images, and in fact doesn't (as far as I can tell) allow transparency on the layer masks at all.
So no real purpose, just habit.