Skip to content

Add shadow effect to libopenshot #999

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

Open
wants to merge 26 commits into
base: develop
Choose a base branch
from

Conversation

aperture147
Copy link
Contributor

@aperture147 aperture147 commented Mar 21, 2025

Currently there are no drop shadow effect implemented in libopenshot. To achieve that, people usually do this trick:

  1. Duplicate the clip that requires shadow dropping
  2. Use Brightness effect to make the duplicated clip pitch black
  3. Use Blur effect to make the black clip under looked like a spread out shadow
  4. Place the Clip below and a bit offset of the original clip

This approach has two disadvantages:

  1. Cannot change the color of the shadow: User might want to change the shadow color to a shift the color and no Hue could shift the the color of black
  2. Inconvenient to use: User has to duplicate the clip, rearrange and modify effects on it. This is not an easy task to do if user has more than one Clip to drop shadow (even when managing them programmatically)

My implementation of Shadow effect could solves those disadvantages by two features:

  1. No extra Clip required.
  2. Shadow color could be keyframed. User could change the color freely

Please check this out! All contributions are appreciated!

@aperture147
Copy link
Contributor Author

This effect uses code from #998, please also check it out @jonoomph!

Copy link

codecov bot commented Mar 25, 2025

Codecov Report

Attention: Patch coverage is 25.17986% with 104 lines in your changes missing coverage. Please review.

Project coverage is 57.01%. Comparing base (9a4dcf2) to head (461752f).

Files with missing lines Patch % Lines
src/effects/Shadow.cpp 0.00% 95 Missing ⚠️
src/Frame.cpp 80.00% 5 Missing ⚠️
src/EffectInfo.cpp 0.00% 3 Missing ⚠️
src/effects/Shadow.h 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #999      +/-   ##
===========================================
- Coverage    57.29%   57.01%   -0.28%     
===========================================
  Files          198      200       +2     
  Lines        18148    18270     +122     
===========================================
+ Hits         10397    10417      +20     
- Misses        7751     7853     +102     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@aperture147
Copy link
Contributor Author

Hi, this PR is related to #998. Please check it out first. I also included test cases for that pull request!

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.

1 participant