manim icon indicating copy to clipboard operation
manim copied to clipboard

Fix `config.background_opacity=0` failing

Open abul4fia opened this issue 1 year ago • 1 comments

Setting background_transparency=0.0 should have the same effect than setting transparent=True. The output format must be compatible with transparency (.mov, .webm). Otherwise ffpmeg fails.

This patch ensures that background_transparency=0.0 triggers the change of the output format. Also a WARNING is raised about the change in the output format.

I want to thank @SirJamesClarkMaxwell for inspiring me to tackle this issue.

Overview: What does this pull request change?

Motivation and Explanation: Why and how do your changes improve the library?

Links to added or changed documentation pages

Further Information and Comments

Reviewer Checklist

  • [ ] The PR title is descriptive enough for the changelog, and the PR is labeled correctly
  • [ ] If applicable: newly added non-private functions and classes have a docstring including a short summary and a PARAMETERS section
  • [ ] If applicable: newly added functions and classes are tested

abul4fia avatar Apr 07 '24 16:04 abul4fia

Wouldn't actually any value for background_opacity smaller than 1 mean that the video should be rendered with transparency?

behackl avatar Apr 25 '24 16:04 behackl

I've pushed some fixes for the behavior of config.background_opacity strictly between 0 and 1, and added an explicit test for the case of config.background_opacity == 0.5.

It would be great if someone could cross-review my changes, otherwise I'm happy to get this merged.

behackl avatar Jul 13 '24 09:07 behackl

I've now properly fixed the logger situation -- sorry, this should probably have been a separate PR. Should be easiest to review by looking at c800ba1 and 78dfd41 separately.

behackl avatar Jul 13 '24 15:07 behackl