gotcha

Author Topic: How to create a 3 colors brush ?  (Read 4602 times)

December 12, 2016, 07:43:07 AM
Read 4602 times

totoche

  • Sr. Newbie

  • Offline
  • **

  • 6
Hello ! I would like to create a brush with 3 parallel colors: is it possible? and how to do that?  :th:

December 12, 2016, 08:29:49 AM
Reply #1

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
Hi.

You can use the bend live path effect for that.
Draw the parallel shapes then group the objects together (Ctrl+G) and add the lpe to the group.
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Paths-LivePathEffects-BendTool.html

December 12, 2016, 09:27:05 AM
Reply #2

totoche

  • Sr. Newbie

  • Offline
  • **

  • 6
 :2tu: Lazur, it is running (after editing nodes!), but it is not exactly what I expect... because, in this case, I must draw rectangles before the effect. That's why I thought it will be great to create a brush with 3 color ribbons, or 4, 5, etc.
(Sorry for my approximative english ! I'm french  :nod:

December 13, 2016, 02:37:40 AM
Reply #3

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Welcome to the forum!
If you're looking for a true brush, you should probably use a raster graphics program, such as GIMP.  You can create brush-like effects with Inkscape, but there's no real brush.

If you can be more specific about what you want to do with Inkscape, we can probably give you some other options.

Here's Lazur's tutorial on creating a realistic paint brush effect with Inkscape.  https://forum.inkscapecommunity.com/index.php?action=articles;sa=view;article=29.  Note that it would take a computer with a lot of RAM to create or display a drawing using that effect to simulate a realistic painting.  Or else there are probably a couple of filters that can be applied to vector objects, to make them look like a painting.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

December 13, 2016, 09:39:13 AM
Reply #4

totoche

  • Sr. Newbie

  • Offline
  • **

  • 6
 :ty1: Brynn. I tried the Lazur method and it was running good, but in one colour as the same time. What I want, it's to draw with a pen which would have 3 colours, as if you had 3 parallel pens in  different colour... is it possible?

December 13, 2016, 11:48:14 AM
Reply #5

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
You cannot do it, as if you were sketching with a 3 colored pen.  You have to build, or construct it, so that it gives the impression that you used a 3 colored pen

If you look at the blue brush stroke at the top of this image (https://forum.inkscapecommunity.com/index.php?action=articles;sa=view;article=29), it is made of 4 colors - 4 different shades of blue.  If you select that object, and take it apart, or dis-assemble it, you can see how it's made.  Once you can understand that, you will realize how to make 3 colors side by side.

If you can show an example of what you're trying to do, we can give you specific steps.  I consider that Lazur's tutorial is using intermediate Inkscape skills, so it is not easy for a beginner to understand.  Depending on what you want to do, there might be some beginner techniques.

For example, the image attached below (3c.png) -- I used the Calligraphy tool, and dragged out 1 fast "line", colored blue.  Then I Duplicated, colored yellow, and moved it up.  Then duplicated again, colored green, and moved it up.  That is a very simple way to do it.

There's another way, which is as close to sketching a 3-colored line as possible, with Inkscape.  Here are steps:

1 -- Draw 3 short lines like I did below
2 -- Select all 3 and Object menu > Group (hold Shift key to make multiple selection).  This is the pattern.
3 -- Using Pen tool  :pen: , draw a longer path which you want the new pattern to follow
4 -- Make sure the pattern is on top, in z-order (Object menu > Raise to top)
5 -- Select both pattern and path, then Extensions menu > Generate from path > Pattern Along Path

(Note that this technique is a little buggy for me.  Even following instructions from the manual, it doesn't always work.  But we can give you some tips to make it work better.)

And there are yet a couple of other ways to do it, but you have to build the effect you want.  You can't sketch with a 3 colored pen.  You have to construct the image which looks like it was drawn with a 3 color pen.

Another way is using Pattern Along Path LPE.  The problem with that one, is that you can't have 3 colors.  You have to do it all with one color.  Then when you're finished, do Path menu > Object to Path.  After that, you can change the color of the other 2.

If none of that answers your question, please show us an example of what you want.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

December 13, 2016, 01:28:34 PM
Reply #6

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
As mentioned the pattern along path lpe is the closest to the behave but that cannot take groups as an input -meaning it cannot draw three different shades as per se.

The bend lpe is the closest for the appearance, so somehow the gap needs to be filled up between the two effects.

Luckily both have an option to link paths.
The bend lpe can use a linked "core" path and the pattern along path can use a linked pattern.

So an idea is to use a pattern along path lpe with a pattern path similar to the end result, and once the layout/drawing is finished,
remove the lpe, copy path, and link it to the three coloured group's bend lpe.

Or similarly, draw with the pattern along path lpe, and when finished, duplicate the paths, and link another base pattern for it, change the fill,
and repeat the process for the third colour.


A hackish workaround would be using custom markers, like in this tutorial.
A bit sloppy and a huge overkill, but it might work.



If you meant parallel by "offsetted" duplicants then a custom filter could do the job in one go.

December 13, 2016, 01:56:29 PM
Reply #7

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
A hackish workaround would be using custom markers, like in this tutorial.
A bit sloppy and a huge overkill, but it might work.

Hah!  You have to flip your mind sideways to think about using markers.  The magic with this technique is the ability to simulate bending  a gradient type of effect, but you could use flat, sharp edges.  And yes, super overkill   :shoot:


totoche, I haven't been able to decide whether pattern along path is too advanced for you, or if it's more about being able to translate effectively, or whether we still don't understand exactly what you're asking.  Please feel free to clarify if it seems like we don't understand  :)
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

December 14, 2016, 05:12:42 AM
Reply #8

totoche

  • Sr. Newbie

  • Offline
  • **

  • 6
 :ty1: to you two. I used this following method: Extensions menu > Generate from path > Pattern Along Path (see the image below), as Brynn said. It is better to make: a not too wide shape + add nodes. For the circle, I had to join the nodes to close the circle. And, I adjusted the options like that:Pattern copy = Repeated / Deformation = ribbon / Space = - 2 / normal gap = 0 / tangential gap = 0.
About the second method from Lazur, I have had difficulties to understand because my english is poor  :-(
specially how to use the 3 objects for the pattern  :help2:
 [ Invalid Attachment ]

December 14, 2016, 03:10:39 PM
Reply #9

totoche

  • Sr. Newbie

  • Offline
  • **

  • 6
 :) The attachement...Extension Motif le long du chemin.jpg
*Extension Motif le long du chemin.jpg
(59.18 kB . 875x621)
(viewed 494 times)

December 15, 2016, 06:28:05 PM
Reply #10

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Ah yes.  Sometimes I have a hard time understanding Lazur's instructions, and English is my only language.  He has a special gift for being about to say a lot of information but with using very few words.  Sometimes I have to go very slow, to understand.  I'll try to explain some of what he mentioned, just so you can learn other ways.

It is better to make: a not too wide shape + add nodes.
Yes, adding extra nodes is one of those tips I was going to mention, if needed.  Since I wasn't sure exactly what your plan was, I didn't know if you would need extra nodes or not.  But it's good that you managed to learn on your own  :)

Here's the basic info about using the Pattern Along Path LPE:

1 - Starting with the 3 colored squares for your pattern -- Duplicate it, if you don't want to lose it, because this will change it.  Ungroup

2 - Path menu > Combine.  You'll probably need to add a stroke, to be able to see the 3 squares, because without a stroke, it will look like one rectangle.  The strokes can be removed later.  (Hold Shift and click any color on the palette.  Or use Object menu > Fill and Stroke > Stroke Paint tab >  :fc:  (Flat Color button))

3 - Draw the path which you want the pattern to follow.

4 - Path menu > Path Effects  (near the bottom of the menu).  Clilck the blue plus sign in the dialog  :lay+:

5 - Choose "Pattern Along Path" and click Add button.

6 - Set up options like in the attachment (sorry for ugly color of my dialog - it's ugly, but soft on my eyes).  I think those are all the default values in the dialog, but I'm not positive.  You can change them later (it's "alive" path effects).

7 - Select the pattern, then Copy (can use button on command bar, Edit menu, or Ctrl c)

8 - Select the path, and click this button in the dialog  :cl:  (this is another way that's "alive")

9 - Now you should see the same result that you had using the extension, except for no color.  But before I tell you how to put the color back, let me show you something cool. 

This only works if you paste the pattern using the clone button ( :cl: ).  If you just ust Ctrl + v or the Paste button, you can't do this.

A - Select the original pattern with the Node tool (:node:).
B - Grab the top-right node of the top square (or any node) and drag it a very short distance
C - Notice what has happened to your path now!

So with this technique, you can start with a general or vague pattern, and later, after it's applied to the path, you can adjust it until it's perfect!

10 - Now to add color.  Of course there are a few ways you could add the color, and everyone learns what's right for themselves.  If you don't need very much precision, you could simply use the Paint Bucket tool.  It's very quick and easy, but it doesn't fill the space very precisely.  There will be small gaps without color, and some places where the color goes outside the strokes.  I would not recommend using it, in this situation.

This is how I would do it. 

10a - Select the PAP result.  Make sure it's perfect, because after this point, you can't use the "live" adjustments anymore.
10b - Path menu > Object to Path
10c - Deselect
10d - Using the Node tool  :node:  you can select each stripe, and give it the color you want.

I hope in the future, the LPE can be made to accept groups.  But even if that's not possible, you can see how powerful this tool can be!

I wouldn't be surprised if Lazur knows some tricks for adding the color.

As it turns out, Inkscape's Pencil tool automatically applies some LPEs.  So instead of using the LPE dialog, you could just use the Pencil tool.  Here's how that would work.

1 - Draw the pattern
2 - Copy the pattern
3 - Enable the Pencil tool, and look at the control bar (just above the top ruler)  Set up the contol bar like in my 2nd attachment
4 - Draw the path

Now when you draw with the Pencil, your pattern is automatically applied.  You still would have to use the Node tool to apply color to the stripes.  But this is faster than using the LPE dialog.

Why didn't I tell you this from the beginning?  So you can have a better understanding how it's working.  Plus, there is no "alive" adjustment using the Pencil tool.  So if you need to edit the pattern which you applied by using the Pencil tool....actually I think you can use the Pen tool as well....  But if you need to edit the pattern which you applied using Pen or Pencil, you have to open the LPE dialog.

Have fun with LPE  :D
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

December 30, 2016, 02:24:44 AM
Reply #11

totoche

  • Sr. Newbie

  • Offline
  • **

  • 6
 :yay: Thank you Brynn ! Your explanations are complete and it works good. Now, i Have 2 methods to draw some patterns...  :clap1: :rose:
See you soon