# P5 LICENSE and p5.library LICENSE questions

**URL:** <https://discourse.processing.org/t/p5-license-and-p5-library-license-questions/38631>\
**Category:** Development\
**Created:** [September 3, 2022, 3:21pm UTC](https://discourse.processing.org/t/p5-license-and-p5-library-license-questions/38631 "2022-09-03T15:21:21Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![meezwhite](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/meezwhite/32/16878_2.png) [@meezwhite](https://discourse.processing.org/u/meezwhite)\
**Post date:** [September 3, 2022, 3:21pm UTC](https://discourse.processing.org/t/p5-license-and-p5-library-license-questions/38631/1 "2022-09-03T15:21:21Z")

</div>

Hi there!

We’re currently developing a p5.js library and we have some questions regarding proper licensing.

1. We would like our library to be licensed under the MIT License. Are we allowed to do this? Or would our library have to be licensed under LGPL-2.1?

2. Our p5.js library repository includes an example directory where standalone examples are included (like so: /examples/example1). Each example includes a minified version of p5.js (like so: /examples/example1/lib/p5.min.js). Besides the p5.js library we include the p5.js license (like so: /examples/example1/lib/p5.min.js.LICENSE).  
We would want the examples to be licenced under the MIT License as well. Are we allowed to do this when using p5.min.js for the examples? Or would the examples have to be licensed under LGPL-2.1?

3. We would like to include in our library a modified vertex shader file similar to vertexColor.vert we found here: [p5.js/vertexColor.vert at main · processing/p5.js · GitHub](https://github.com/processing/p5.js/blob/main/src/webgl/shaders/vertexColor.vert)  
Are we allowed to do this and still license our library under the MIT license? Or would we have to license our library under LGPL-2.1?

Licenses are not easy, so we would appreciate some help.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [September 3, 2022, 4:29pm UTC](https://discourse.processing.org/t/p5-license-and-p5-library-license-questions/38631/2 "2022-09-03T16:29:01Z")

</div>

> [@meezwhite](#):
>
> We’re currently developing a p5.js library…

- Is it an addon to the original p5.js library or a p5.js-based library?
- For the former, you’re free to choose its license.
- For the latter, you’re bound to LGPL-2.1 rules regarding derivative work; which I’m afraid can’t be re-licensed to MIT.

---

<div class="post-metadata">

**Author:** ![meezwhite](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/meezwhite/32/16878_2.png) [@meezwhite](https://discourse.processing.org/u/meezwhite)\
**Post date:** [September 3, 2022, 6:24pm UTC](https://discourse.processing.org/t/p5-license-and-p5-library-license-questions/38631/4 "2022-09-03T18:24:36Z")

</div>

It’s a p5 library like p5.sound (but not for sound). Is that what you mean by “addon”?

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [September 3, 2022, 6:26pm UTC](https://discourse.processing.org/t/p5-license-and-p5-library-license-questions/38631/5 "2022-09-03T18:26:42Z")

</div>

> [@meezwhite](#):
>
> Is that what you mean by “addon”?

Yes! A p5js addon is a library that merely extends p5js w/o modifying its original source code.

Here’s a simple example of a code that adds a new method **resizeNN()** to [p5.Image](https://p5js.org/reference/#/p5.Image) while keeping the rest of that class intact:

- [Extends p5.Image to handle nearest neighbor resizing for scaling images w/o blurring. · GitHub](https://gist.github.com/GoToLoop/2e12acf577506fd53267e1d186624d7c)

---

<div class="post-metadata">

**Author:** ![meezwhite](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/meezwhite/32/16878_2.png) [@meezwhite](https://discourse.processing.org/u/meezwhite)\
**Post date:** [September 3, 2022, 6:43pm UTC](https://discourse.processing.org/t/p5-license-and-p5-library-license-questions/38631/6 "2022-09-03T18:43:00Z")

</div>

Now we understand each other. 🙂

That answers my first question. We can license our p5 library (addon) under the MIT Licence. ✔

What do you think about the other two?

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [September 3, 2022, 8:16pm UTC](https://discourse.processing.org/t/p5-license-and-p5-library-license-questions/38631/7 "2022-09-03T20:16:06Z")

</div>

> [@meezwhite](#):
>
> 1. Each example includes a minified version of p5.js…

As long as the distributed p5.js is unmodified in any way you’re totally OK.

> [@meezwhite](#):
>
> 1. We would like to include in our library a modified vertex shader file similar to “vertexColor.vert”…

Again, what’s important to keep in mind is that the “p5.js” file is distributed unmodified.

Now, is your “.vert” file derived from p5js’ original “vertexColor.vert” or is it a solution of your own or some1 else?

BtW, this is the pull request which 1st added file “vertexColor.vert” to the p5js library:

> <https://github.com/processing/p5.js/pull/820>
>
> Immediate and retained drawing modes to support beginShape() and endShape() as w…ell as 3d primitives. xyz drawing origin now defaults to center of screen instead of top left. If you want to go back to the Processing / OF style 3D origin, it's as easy as calling the function: 
> 
> \`\`\`
> originMode('TOP\_LEFT');
> \`\`\`

> <https://github.com/processing/p5.js/blob/0.4.8/src/3d/shaders/vertexColor.vert>

---

<div class="post-metadata">

**Author:** ![meezwhite](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/meezwhite/32/16878_2.png) [@meezwhite](https://discourse.processing.org/u/meezwhite)\
**Post date:** [September 5, 2022, 3:43pm UTC](https://discourse.processing.org/t/p5-license-and-p5-library-license-questions/38631/8 "2022-09-05T15:43:00Z")

</div>

Okay cool! We can license our examples under MIT by using the unmodified p5.js library. ✔

Now regarding the “.vert” file. I’m the one making sure we use the proper license. 🙂

We don’t yet have a vertex shader file that solves our problem. We know that we need something similar to “vertexColor.vert” but not exactly the same.

I assume that by using p5’s “vertexColor.vert” we would have to release our library under LGPL-2.1, right?

Since we want to release our library under the MIT License, we would have to code a solution ourselves or have somebody code it for us.

My confusion is: if somebody codes it for us **independently** from p5’s “vertexColor.vert” and the solution ends up having some similar lines of code, would that be an issue?

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [September 5, 2022, 8:43pm UTC](https://discourse.processing.org/t/p5-license-and-p5-library-license-questions/38631/9 "2022-09-05T20:43:16Z")

</div>

> [@meezwhite](#):
>
> My confusion is: if somebody codes it for us **independently** from p5’s “vertexColor.vert” and the solution ends up having some similar lines of code, would that be an issue?

I simply dunno. That’s 1 of the reasons I’ve looked up for the “.vert” pull request’s author.

I’ve no idea if he had coded those “.vert” files or simply got them from somewhere else.

---

<div class="post-metadata">

**Author:** ![meezwhite](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/meezwhite/32/16878_2.png) [@meezwhite](https://discourse.processing.org/u/meezwhite)\
**Post date:** [September 5, 2022, 11:31pm UTC](https://discourse.processing.org/t/p5-license-and-p5-library-license-questions/38631/10 "2022-09-05T23:31:13Z")

</div>

Alright, thanks, this already helped! 🙂
