Skip to content

Commit

Permalink
clear canvas for non canvas filters
Browse files Browse the repository at this point in the history
  • Loading branch information
eyaler committed May 5, 2024
1 parent 43528b6 commit c5f25b1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,8 @@ async function capture() {
let rgba = new Uint8ClampedArray(W * H * 4)
if (effect.value.includes('landmarks'))
effect_funcs['pose_landmarks'](W, H, videoFrame, poseLandmarker, canvasCtx, drawingUtils)
else
canvasCtx.clearRect(0, 0, W, H)
if (effect.value == 'pose_landmarks')
rgba = rgba.map((_, i) => ((i+1) % 4 == 0) * 255)
else {
Expand Down

0 comments on commit c5f25b1

Please sign in to comment.