FiniteSingularity / obs-composite-blur

A comprehensive blur plugin for OBS that provides several different blur algorithms, and proper compositing.
GNU General Public License v2.0
382 stars 31 forks source link

[BUG] - Masking with source alpha not working as expected #49

Closed ASchneiderBR closed 1 year ago

ASchneiderBR commented 1 year ago

Describe the bug

When using the Composite Blur filter and trying to mask using a source with alpha information, the mask does not work as expected.

To Reproduce

  1. Add an image source with chroma key filters applied to create transparency
  2. Add a 1080p video source to blur
  3. Add Composite Blur filter to video source
  4. Set Composite Blur to mask using the image source
  5. The mask has no effect on the blur

Expected behavior

I expected the alpha channel of the image source to properly mask the blur effect on the video source.

Screenshots

https://streamable.com/65y76i

Environment

GPU

Additional context

I am scaling a 4K PNG image source with transparency down to 1080p using chroma key filters, and attempting to use it to mask blur on a 1080p video source. It seems like the mask functionality is not working properly in this case.

FiniteSingularity commented 1 year ago

Hi @ASchneiderBR-

Thank you for the fantastic issue report (I very much appreciate the linked video that clearly shows the issue). I was easily able to replicate the issue, and am seeing the same thing you see. It seems to be unique to the image source (other source types seem to work fine with chroma keying). I'll dive into this and try to find out a fix.

In the meantime, I was able to find a workaround:

  1. Create a new empty scene, call it Keyed Image Scene
  2. Add your image to the new scene, call it Keyed Image
  3. Apply the chroma key to the image source like before.
  4. For the source you want to mask blur on, select Keyed Image Scene for the masking source instead of the original image source.
  5. You should now see a proper mask using the chroma keyed image.

For some reason, having the image embedded in a scene allows the alpha information to come through, while selecting just the image source does not.

FiniteSingularity commented 1 year ago

Found the issue, and have a fix on the way. Will try to merge in this afternoon, and combine with the fix for #47 and release a new version.

ASchneiderBR commented 1 year ago

Thank you very much! AI is just amazing for creating issues as I recently discovered :) I'm glad I could help in any way, your plugin is just incredible and deserves all of the best. Have a great day!

FiniteSingularity commented 1 year ago

@all-contributors please add @ASchneiderBR for bug

allcontributors[bot] commented 1 year ago

@FiniteSingularity

I've put up a pull request to add @ASchneiderBR! :tada: