Skip to content

Comments

Handle premultiplied alpha in filter(OPAQUE)#6529

Merged
Qianqianye merged 3 commits intoprocessing:mainfrom
davepagurek:fix/opaque
Nov 23, 2023
Merged

Handle premultiplied alpha in filter(OPAQUE)#6529
Qianqianye merged 3 commits intoprocessing:mainfrom
davepagurek:fix/opaque

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
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