# Brushstroke for Drawing Program

**URL:** <https://discourse.processing.org/t/brushstroke-for-drawing-program/27300>\
**Category:** Processing\
**Created:** [January 23, 2021, 5:25am UTC](https://discourse.processing.org/t/brushstroke-for-drawing-program/27300 "2021-01-23T05:25:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prxt.3k](https://avatars.discourse-cdn.com/v4/letter/p/9e8a1a/32.png) [@Prxt.3k](https://discourse.processing.org/u/Prxt.3k)\
**Post date:** [January 23, 2021, 5:25am UTC](https://discourse.processing.org/t/brushstroke-for-drawing-program/27300/1 "2021-01-23T05:25:37Z")

</div>

![Screenshot 2021-01-22 221546](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/a/a75425a80d94a5e35d57b9eb37816366169d1078.png)

Anyone know whats the code for a Crayon and Paintbrush-like stroke?

Thanks,

---

<div class="post-metadata">

**Author:** ![micycle](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micycle/32/201_2.png) [@micycle](https://discourse.processing.org/u/micycle)\
**Post date:** [January 23, 2021, 2:44pm UTC](https://discourse.processing.org/t/brushstroke-for-drawing-program/27300/2 "2021-01-23T14:44:26Z")

</div>

A starting point:

[http://perfectionkills.com/exploring-canvas-drawing-techniques/](http://perfectionkills.com/exploring-canvas-drawing-techniques/)

and

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/7/79e70ed853aa1e9ab6bcede4e6a9f9af6dc0647e.png)  
(from [here](https://engweb.swan.ac.uk/~cfli/papers_pdf_files/2011_VC_Painterly_rendering_with_content-dependent_natural_paint_strokes.pdf))

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [January 23, 2021, 3:27pm UTC](https://discourse.processing.org/t/brushstroke-for-drawing-program/27300/3 "2021-01-23T15:27:13Z")

</div>

**11 is the number of points per frame**

```auto
if (mode==brushMode) {
    if (startX>=0) {
      noFill();
      for (int i=0; i<11; i++) {
        float r=random(18);
        float angle = random(TWO_PI); 
        float x1=(r*cos(angle)) + mouseX;
        float y1=(r*sin(angle)) + mouseY;
        stroke(255, 0, 0); 
        point(x1, y1);
      }
    }
  }

```

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [January 23, 2021, 6:39pm UTC](https://discourse.processing.org/t/brushstroke-for-drawing-program/27300/4 "2021-01-23T18:39:04Z")

</div>

a lot of brushes: [Browse Sketches - OpenProcessing](https://www.openprocessing.org/browse/?time=anytime&type=all&q=draw#)
