zigzag gradient

Post questions on how to use or achieve an effect in Inkscape.
anon13
Posts: 32
Joined: Thu Dec 05, 2013 6:59 am

zigzag gradient

Postby anon13 » Sat Dec 12, 2015 9:53 am

screenshot.2015-12-11 (2).png
screenshot.2015-12-11 (2).png (12.28 KiB) Viewed 2433 times


I've created a linear gradient and then duplicated, flipped etc to make it look like the gradient follws a zigzag line, but 1) is it possible do this with one gradient and 2) if not then how do I get rid of those pesky white lines between the duplications?
Inkscape 0.91 / Windows 7 / 64bit

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: zigzag gradient

Postby Lazur » Sat Dec 12, 2015 11:30 am

Hi.

That is the result of anti-aliasing, the gap is where the background shows through the edge where the two objects meet.
No matter if they are geometrically perfect, you will see the artifact if you don't use overlapping of objects larger than the rendering resolution's pixel.
Tried to make a brief explanation about it some time ago, would definitely need to get back to it as soon as possible.

-self advertising goes here:
check >this< collection for examples drawn caring nit-pickingly on anti-aliasing-

Theoretically the issue won't appear if you switch anti-aliasing off in the document's properties (Shift+Ctrl+D) or apply a pixellize filter to the objects/group of objects.


Drawing the gradient as one?
You can convert a base object -group of gradiented squares- to a pattern and use it to fill up a random shape.



Other than that your example image can be redrawn by superimposing two repeating gradients, one semi-transparent over a fully opaque one.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: zigzag gradient

Postby brynn » Sat Dec 12, 2015 12:38 pm

Lazur URH wrote:Drawing the gradient as one?
You can convert a base object -group of gradiented squares- to a pattern and use it to fill up a random shape.

Other than that your example image can be redrawn by superimposing two repeating gradients, one semi-transparent over a fully opaque one.


But it cannot be done with a single gradient. (for clarity :D)

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: zigzag gradient

Postby Lazur » Sat Dec 12, 2015 9:38 pm

But it can be done with one gradient mesh.

In theory, haven't tried such myself yet.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: zigzag gradient

Postby brynn » Sun Dec 13, 2015 12:51 am

Lazur URH wrote:But it can be done with one gradient mesh.

Absolutely!

anon13
Posts: 32
Joined: Thu Dec 05, 2013 6:59 am

Re: zigzag gradient

Postby anon13 » Mon Dec 14, 2015 7:02 am

Hi Lazur!
Are the gaps just on the screen or would they be seen on a printout? Because overlapping is more awkward when I'm drawing and snapping to a grid.

Is there an advantage or disadvantage to switching anti-aliasing off?

That's a good cheat, thank you. But possibly not worth the effort and would probably throw up other issues like smooth transitions between gradiented shapes.

Huh? Sorry, I don't understand what you mean/how that would work.


brynn - thank you for clarifying (:


Lazur - O: Inkscape has gradient mesh??
Inkscape 0.91 / Windows 7 / 64bit

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: zigzag gradient

Postby Lazur » Mon Dec 14, 2015 7:11 am

Hi.

Gradient mesh is not part of the current svg specs, it's "under development".
The new spec is on the way for a long time, and some development builds do have that feature.
I haven't tried it, if remember right it got off from the main development branch. There is a topic around here on gradient meshes but probably the links inside pointing to download pages are outdated.


Theoretically you won't see any artifact in printing of those "gaps".
Printers don't use anti-aliasing. Even if they did, with a 300 dpi minimum resolution the 1 px/dot gap would be less than 0,1 mm wide.


Advantage or disadvantage? It's personal taste, some like smooth edges more than sharp pixels.


Edit: here is a possible solution of drawing it
gradi.svg
(5.05 KiB) Downloaded 149 times

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: zigzag gradient

Postby Moini » Mon Dec 14, 2015 7:47 am

if remember right it got off from the main development branch


It is in the current development branch, the main one. You can download and install compiled Windows, Ubuntu, (Fedora?) and OSX versions from the links listed at the bottom of this web page (but of course, the devel version has a few bugs - other ones than the stable version):

https://inkscape.org/en/download/

(is the trick of just duplicating the object working here to reduce the gaps?)
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: zigzag gradient

Postby Lazur » Mon Dec 14, 2015 8:10 am

In my humble opinion duplicating objects on top of eachother is an unpleasant workaround.
If it reduces the problem -seemingly- by producing many seemingly unnecessary objects, then what if you want to tweak the shape later on? Group them and use clipping?
And it produces an aliased look at the object's other edges.

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: zigzag gradient

Postby Moini » Mon Dec 14, 2015 8:19 am

I'd just delete the duplicate and duplicate again - that's quicker ;)
And yes, I know it's only a workaround, not a solution - it's better than nothing, as the gaps are more obvious than the edges thing.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: zigzag gradient

Postby brynn » Mon Dec 14, 2015 8:22 am

Moini wrote:
if remember right it got off from the main development branch


It is in the current development branch, the main one. You can download and install compiled Windows, Ubuntu, (Fedora?) and OSX versions from the links listed at the bottom of this web page (but of course, the devel version has a few bugs - other ones than the stable version):

https://inkscape.org/en/download/


The last time I looked, the dev version of Ponyscape also has a dev version of gradient mesh. I'm not sure if gradient mesh tool is in the same state in both.

http://ponyscape-vectors.deviantart.com/

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: zigzag gradient

Postby Lazur » Mon Dec 14, 2015 8:48 am

All right, here they are:

gradient mesh

key binding

Edit:
~suv wrote:
Off topic:
Moini wrote:I tried it - here's a screenshot: http://graphicdesign.stackexchange.com/ ... cape?atw=1
It's still a little awkward to use - and won't show in browsers, or on OCAL, of course - animation is out of question currently ;)
Just a quick reminder (referring to the answer you gave on stackexchange) - current available 32bit devel builds for Windows won't work for mesh gradients: Inkscape's 32bit devlibs for Windows include an outdated version of cairo (1.11.2) which does not support mesh gradients yet (they don't render on Inkscape's canvas visibly if Inkscape uses cairo < 1.12).


http://www.inkscapeforum.com/viewtopic.php?f=9&t=13514&p=74748#p74748


Edit 2: just tried it for the first time, it does work on the current stabile 64bit. Experimenting.

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: zigzag gradient

Postby Moini » Mon Dec 14, 2015 9:03 am

Right - I keep forgetting it's already in 0.91, just not obviously accessible... :/ Thanks, Lazur!
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: zigzag gradient

Postby Lazur » Mon Dec 14, 2015 10:02 am

After trying gradient meshes, first notices.
You cannot transform duplicants of an object with a gradient mesh, not even if they are put inside a group, not even if the transformation is a simple translate. Pretty much of a show stopper many times.
Raster copy can be made of the object, yes.
But then again, for the original image even a raster image could be rendered as alike of 2 px / 8 px size.

Pdf-s with gradient meshes cannot yet be imported preserving gradient meshes.


@su_v
it's not a stable feature, and no one claims it is nor is it advertised as such
patches are welcome, as well as implementation of missing features (e.g. copy)


Return to “Help with using Inkscape”