Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle premultiplied alpha in filter(OPAQUE) #6529

Merged
merged 3 commits into from
Nov 23, 2023

Conversation

davepagurek
Copy link
Contributor

Resolves #6528

Changes

  • Handles the fact that filter input has its alpha channel premultiplied. It needs to be unmultiplied to not result in darker colors before changing the alpha.

Screenshots of the change

https://editor.p5js.org/davepagurek/sketches/OXcL-h7ui

This sketch is now full red instead of dark red.

Before:
image

After:
image

PR Checklist

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

@davepagurek davepagurek mentioned this pull request Nov 6, 2023
3 tasks
@inaridarkfox4231
Copy link
Contributor

I feel like a similar problem is probably occurring with POSTERIZE and THRESHOLD(though I'm not sure how important handling of low opacity is...)

@davepagurek
Copy link
Contributor Author

good catch @inaridarkfox4231! I've updated those shaders, live here: https://editor.p5js.org/davepagurek/sketches/HBU7vSmuk

@Qianqianye Qianqianye merged commit bfb5b9b into processing:main Nov 23, 2023
2 checks passed
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.

filter(OPAQUE) darkens semi-transparent colors
3 participants