FiniteSingularity / obs-stroke-glow-shadow

An OBS plugin to provide efficient Stroke, Glow, and Shadow effects on masked sources.
GNU General Public License v2.0
110 stars 8 forks source link

[FEATURE] - Custom size stroke for cropped sources #38

Open ChugaChugaChooChoo opened 6 months ago

ChugaChugaChooChoo commented 6 months ago

I want to add a stroke to a game I play called osu! in obs, I have the game cropped in obs and cant use the stroke as it effects only the outside border of the source

image

ChugaChugaChooChoo commented 6 months ago

More specifically, have width and height offset, and allow a larger offset. Trying to figure out your code but I'm not smart enough to find where or how to do that

FiniteSingularity commented 6 months ago

Hi @ChugaChugaChooChoo . Apologies for taking a while to get back to you- I was traveling and had very spotty mobile access. I’ll take a look over the next couple days and get back to you with more details.

FiniteSingularity commented 6 months ago

@ChugaChugaChooChoo,

This one might be a bit of a challenge to fix within the plugin as it will require multiple scaling/cropping steps, but I will definitely look into it.

In the meantime, there is a workaround that should work for you.

Here I have a source similar to your capture source- lets say the sky blue color is what you wanted to stroke, and you wanted to get rid of the outer 100px turquoise border: image

  1. Add a Crop/Pad filter to crop in to the area you want to save- in my example it is 100px all around: image
  2. Add a second Crop/Pad filter after the first crop/pad, and apply a negative padding wide enough to accommodate for the stroke. In my case I used -20px all around: image
  3. Finally, after these two Crop/Pad filters (the order of the filters in the stack is important) add a stroke. The negative padding gives the filter room to add a stroke around the source: image

I think this should accomplish what you're wanting, but I will definitely look into how this might be built into the plugin. If I am misunderstanding what you are trying to do, please post some more details/corrections here and I am happy to look into it further.

ChugaChugaChooChoo commented 6 months ago

Workaround works, thanks very much

FiniteSingularity commented 6 months ago

Glad to hear it works. I'll keep this open until I see if the functionality can realistically be added directly within the plugin.