# P5js WebGL sketch exports with transparent background

**URL:** <https://discourse.processing.org/t/p5js-webgl-sketch-exports-with-transparent-background/20023>\
**Category:** p5.js\
**Created:** [April 22, 2020, 8:46am UTC](https://discourse.processing.org/t/p5js-webgl-sketch-exports-with-transparent-background/20023 "2020-04-22T08:46:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![1igor](https://avatars.discourse-cdn.com/v4/letter/1/8dc957/32.png) [@1igor](https://discourse.processing.org/u/1igor)\
**Post date:** [April 22, 2020, 8:46am UTC](https://discourse.processing.org/t/p5js-webgl-sketch-exports-with-transparent-background/20023/1 "2020-04-22T08:46:20Z")

</div>

Hi! I have a problem with WebGL: anything in browser works fine but when I try to save image or use CCapture, it exports my canvas with transparent background instead of one I have. I have tried setting background using `background('#FFFFFF');`, I have also tried creating rect with the size of canvas but it doesn’t help. I can find some articles saying that it is a common issue with WebGL, but I couldn’t find any working solutions to fix this in p5js.

---

<div class="post-metadata">

**Author:** ![1igor](https://avatars.discourse-cdn.com/v4/letter/1/8dc957/32.png) [@1igor](https://discourse.processing.org/u/1igor)\
**Post date:** [April 22, 2020, 9:25am UTC](https://discourse.processing.org/t/p5js-webgl-sketch-exports-with-transparent-background/20023/2 "2020-04-22T09:25:33Z")

</div>

Looks like background works OK until I create a `box` with transparent `emissiveMaterial`. The background beyond this. Looks like the background below that box also becomes transparent.
