Quantcast
Channel: HTML5 Canvas Make Black Transparent - Stack Overflow
Viewing all articles
Browse latest Browse all 5

Answer by user3325025 for HTML5 Canvas Make Black Transparent

$
0
0

Felipe's answer addressed my issue. Alpha pixel manipulation does not work(eg, setting every 4th pixel to 0) for preserving alphatransparency with multiple images added into the same context at the same time.

eg:

this.ctx1.putImageData(output, 0, 0); // without setting the context's globalCompositeOperation, this image is written over by the next putImage operationthis.ctx1.putImageData(output, 20, 0);

Go here to review the blending options. https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation


Viewing all articles
Browse latest Browse all 5

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>