Skip to content

Transparent background -t doesn't work #473

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

Closed
FilipeMarch opened this issue Sep 24, 2020 · 6 comments
Closed

Transparent background -t doesn't work #473

FilipeMarch opened this issue Sep 24, 2020 · 6 comments
Labels
pr:bugfix Bug fix for use in PRs solving a specific issue:bug

Comments

@FilipeMarch
Copy link

I was used to do something like:

class Alphabet(Scene):
    def construct(self):
        alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
        for letter in alpha:
            text = TextMobject(letter).set_height(7.5).set_color(BLACK)
            self.add(text)
            self.wait(0.1)
            self.remove(text)
python -m manim script3.py Alphabet -pt

Getting this:
ezgif com-video-to-gif

Using the same script and shell command with ManimCE produces this:
image

@naveen521kk naveen521kk added the pr:bugfix Bug fix for use in PRs solving a specific issue:bug label Sep 24, 2020
@huguesdevimeux
Copy link
Member

Thanks for the report.
This is probably due to this line that is not present in manim ce :

https://github.com/3b1b/manim/blob/19e3c97589181ffd43ef14d9169af4e40e054664/manimlib/config.py#L162

This should probably be an easy fix, realted to config. Cc @leotrs

@kolibril13
Copy link
Member

kolibril13 commented Oct 14, 2020

I just had a look on it.
If I run manim with -t,

class ABC(Scene):
    def construct(self):
        dot = Dot().set_color(GREEN)
        self.add(dot)
        self.wait(1)
        print(*file_writer_config.items() , sep = "\n")

that tells me

('png_mode', 'RGBA')
('movie_file_extension', '.mov')

So in principle, that is what we want to have.
Also, with the -t tag, manim goes to the scene_file_writer.py into the if statement:

        if file_writer_config["movie_file_extension"] == ".mov":
            # This is if the background of the exported
            # video should be transparent.
            command += [
                "-vcodec",
                "qtrle",
            ]

So it even uses the codec for transparency.
As I have some time tomorrow, can you tell me where I have to look and make changes? :)

@leotrs
Copy link
Contributor

leotrs commented Oct 15, 2020

I'm not sure where to make the changes, but if you end up working on that please make sure to add a test for this so there are no regressions.

@behackl behackl added this to the v0.2 milestone Oct 22, 2020
@eulertour eulertour mentioned this issue Oct 22, 2020
6 tasks
@leotrs
Copy link
Contributor

leotrs commented Oct 28, 2020

Note to self: this will be fixed by #620

@leotrs
Copy link
Contributor

leotrs commented Oct 29, 2020

@FilipeMarch would you please kindly pull the latest master branch and try again? I believe this should be fixed now :)

@leotrs
Copy link
Contributor

leotrs commented Oct 31, 2020

@kolibril13 has confirmed that the -t flag now works.

@leotrs leotrs closed this as completed Oct 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:bugfix Bug fix for use in PRs solving a specific issue:bug
Projects
None yet
Development

No branches or pull requests

6 participants