libopenshot icon indicating copy to clipboard operation
libopenshot copied to clipboard

Add shadow effect to `libopenshot`

Open aperture147 opened this issue 10 months ago • 3 comments

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 avatar Mar 21 '25 10:03 aperture147

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

aperture147 avatar Mar 25 '25 07:03 aperture147

Codecov Report

:x: Patch coverage is 25.17986% with 104 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 57.04%. Comparing base (7b4e999) to head (b8238bb).

Files with missing lines Patch % Lines
src/effects/Shadow.cpp 0.00% 95 Missing :warning:
src/Frame.cpp 80.00% 5 Missing :warning:
src/EffectInfo.cpp 0.00% 3 Missing :warning:
src/effects/Shadow.h 0.00% 1 Missing :warning:
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #999      +/-   ##
===========================================
- Coverage    57.31%   57.04%   -0.28%     
===========================================
  Files          198      200       +2     
  Lines        18166    18288     +122     
===========================================
+ Hits         10412    10432      +20     
- Misses        7754     7856     +102     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar Mar 25 '25 07:03 codecov[bot]

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

aperture147 avatar Apr 07 '25 08:04 aperture147