manim icon indicating copy to clipboard operation
manim copied to clipboard

Default config for manim project switches pixel_height with pixel_width

Open DominQu opened this issue 11 months ago • 1 comments

Description of bug / unexpected behavior

When following the quickstart guide, I created a manim project with the command: manim init project my-project --default. This created a manim.cfg file with the following contents:

[CLI]
frame_rate = 30
pixel_height = 854
pixel_width = 480
background_color = BLACK
background_opacity = 1
scene_names = Default

The values of pixel_height and pixel_width are switched. This leads to animations being zoomed in and wrong frame_width. When I set pixel_width=854 and pixel_height=480 everything goes back to normal.

Expected behavior

Default manim.cfg file contains proper resolution, that is:

[CLI]
frame_rate = 30
pixel_height = 480
pixel_width = 854
background_color = BLACK
background_opacity = 1
scene_names = Default

How to reproduce the issue

Code for reproducing the problem
manim init project my-project --default

Additionally, you can add a line: print(config.frame_width) to main.py in my-project and verify that the value of config.frame_width != 14.2(3).

Additional media files

Images/GIFs

Logs

Terminal output
PASTE HERE OR PROVIDE LINK TO https://pastebin.com/ OR SIMILAR

System specifications

System Details
  • OS (with version, e.g., Windows 10 v2004 or macOS 10.15 (Catalina)): macOS 15.3
  • RAM:
  • Python version (python/py/python3 --version): 3.9
  • Installed modules (provide output from pip list):
manim==0.19.0
LaTeX details
  • LaTeX distribution (e.g. TeX Live 2020):
  • Installed LaTeX packages:

Additional comments

DominQu avatar Feb 21 '25 10:02 DominQu

I made a PR fixing the issue.

The pixel_width and pixel_height were being set out of order.

# manim/cli/init/commands.py
if key == "resolution":
     cli_config["pixel_height"] = str(value[0])
     cli_config["pixel_width"] = str(value[1])

Swapping the values fixes the issue.

# manim/cli/init/commands.py
if key == "resolution":
     cli_config["pixel_width"] = str(value[0])
     cli_config["pixel_height"] = str(value[1])

StevenH34 avatar Apr 07 '25 01:04 StevenH34