# globalCompositeOperation in P5

**URL:** <https://discourse.processing.org/t/globalcompositeoperation-in-p5/29105>\
**Category:** Coding Questions\
**Created:** [April 4, 2021, 12:47am UTC](https://discourse.processing.org/t/globalcompositeoperation-in-p5/29105 "2021-04-04T00:47:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hellonearthis](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hellonearthis/32/3482_2.png) [@hellonearthis](https://discourse.processing.org/u/hellonearthis)\
**Post date:** [April 4, 2021, 12:47am UTC](https://discourse.processing.org/t/globalcompositeoperation-in-p5/29105/1 "2021-04-04T00:47:27Z")

</div>

I was watching the video below talk about the [globalCompositeOperation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation)  
And I wondered how this is used in P5.js

It’s similar but different to (blendmode)[[\<blend-mode\> - CSS: Cascading Style Sheets | MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/blend-mode)]

So I made this [tester](https://editor.p5js.org/hellonearthisman/sketches/HPNUE8cfG), there are some interesting effects

[![]( " - YouTube") ](https://www.youtube.com/watch?v=BmEAJbAihFU)

---

<div class="post-metadata">

**Author:** ![ReyzArtz](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/reyzartz/32/11750_2.png) [@ReyzArtz](https://discourse.processing.org/u/ReyzArtz)\
**Post date:** [April 4, 2021, 6:55am UTC](https://discourse.processing.org/t/globalcompositeoperation-in-p5/29105/2 "2021-04-04T06:55:30Z")

</div>

Yes, there is a function called blend() in p5.Image you can check it out over here:  
[blend() Reference](https://p5js.org/reference/#/p5.Image/blend)
