Skip to content

Film Grain effect#1063

Merged
jonoomph merged 5 commits intodevelopfrom
film-grain
May 2, 2026
Merged

Film Grain effect#1063
jonoomph merged 5 commits intodevelopfrom
film-grain

Conversation

@jonoomph
Copy link
Copy Markdown
Member

The Film Grain effect adds a gentle moving texture to your video, similar to the tiny speckles you see in real film photography. This can make very clean digital footage feel warmer, more natural, or more cinematic. It can also help blend mixed footage together, especially when one clip looks too sharp or too smooth compared to the rest of your project.

…ile-scaled grain rendering, bindings, registration, and unit tests. Also update Analog Tape artifact

  scaling so preview and export sizes stay visually consistent.
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 25, 2026

Codecov Report

❌ Patch coverage is 93.55164% with 128 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.34%. Comparing base (a585652) to head (337e0d3).

Files with missing lines Patch % Lines
src/FrameScope.cpp 86.25% 51 Missing ⚠️
src/effects/ColorGrade.cpp 92.88% 20 Missing ⚠️
src/FrameScope.h 60.46% 17 Missing ⚠️
src/AnimatedCurve.cpp 87.20% 16 Missing ⚠️
src/effects/FilmGrain.cpp 95.30% 10 Missing ⚠️
src/EffectInfo.cpp 33.33% 4 Missing ⚠️
src/effects/AnalogTape.cpp 86.66% 2 Missing ⚠️
src/effects/ColorGrade.h 0.00% 2 Missing ⚠️
src/effects/FilmGrain.h 0.00% 2 Missing ⚠️
tests/Clip.cpp 99.23% 2 Missing ⚠️
... and 2 more
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1063      +/-   ##
===========================================
+ Coverage    66.15%   68.34%   +2.18%     
===========================================
  Files          220      232      +12     
  Lines        24756    26731    +1975     
===========================================
+ Hits         16377    18268    +1891     
- Misses        8379     8463      +84     

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

@jonoomph
Copy link
Copy Markdown
Member Author

Film Grain Effect

…ation_x/y did not correctly calculate the offscreen coordinates. This will have backwards compatibility implications, since old projects that combine custom location_x/y + CROP scale mode will calculate position differently now.

Added tests:
- location_x/y = -1/+1 offscreen behavior for all scale enums and multiple scale_x/y combinations.
- all 9 gravity anchors when location_x/y = 0, including sub-100% and non-uniform scale.
- Crop-specific intermediate location behavior so the original bug stays covered.
# Conflicts:
#	src/CMakeLists.txt
#	src/EffectInfo.cpp
#	src/Effects.h
#	tests/CMakeLists.txt
- Cache y-pre-lerped bilinear columns for soft and clump noise, refreshing only when the x-cell index changes (~every 7 px for soft, ~every 9 px for clump at defaults). Fine grain hash is similarly cached per cell. This cuts amortized hash_coords + mix32 calls from ~56 to ~9 per pixel in the fully-featured case.
- hoist all y-dependent values out of the x-loop; replace std::round in clampByte; extract salt magic numbers to named constants; move alpha_percent to the write-back branch where it's actually needed; collapse the color-apply branch to use_color_variation directly.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 2, 2026

Merge conflicts have been detected on this PR, please resolve.

@github-actions github-actions Bot added the conflicts A PR with unresolved merge conflicts label May 2, 2026
@jonoomph jonoomph merged commit 055ae45 into develop May 2, 2026
3 of 11 checks passed
@jonoomph jonoomph deleted the film-grain branch May 2, 2026 04:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflicts A PR with unresolved merge conflicts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant