Skip to content

Conversation

@davepagurek
Copy link
Contributor

Resolves #5868

Past me took out this call to loadPixels() for p5.MediaElements because I thought it was just populating the pixels array, which the new tint implementation no longer needs. However, it was also ensuring that they have a canvas property with a screenshot of the current frame in it, which tint() does need.

This ensures that tinted p5.MediaElements have a canvas (without the overhead of loading pixels), which allows them to work with the new tint implementation rather than returning early.

Screenshots of the change:

Tinting the webcam works again!
image

Live version: https://editor.p5js.org/davepagurek/sketches/Owc30NXkE

PR Checklist

  • npm run lint passes
  • [Inline documentation] is included / updated
  • [Unit tests] are included / updated

@limzykenneth limzykenneth merged commit b9c3bce into processing:main Nov 24, 2022
@limzykenneth
Copy link
Member

Looks good. Thanks!

@davepagurek davepagurek deleted the fix/mediaelement-tint branch November 24, 2022 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tint not working on webcam

2 participants