Skip to content

Commit b42290f

Browse files
Add --img-format option to export images to png
Signed-off-by: Jacob Stopak <jacob@initialcommit.io>
1 parent 0d4b39a commit b42290f

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

git_sim/__main__.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,18 @@ def main():
152152
)
153153
parser.add_argument(
154154
"--video-format",
155-
help="Output format for the animation files. Supports mp4 and webm",
155+
help="Output format for the animation files. Supports mp4 (default) and webm",
156156
type=str,
157157
default="mp4",
158158
choices=["mp4", "webm"],
159159
)
160+
parser.add_argument(
161+
"--img-format",
162+
help="Output format for the image files. Supports jpg (default) and png",
163+
type=str,
164+
default="jpg",
165+
choices=["jpg", "png"],
166+
)
160167

161168
subparsers = parser.add_subparsers(dest="subcommand", help="subcommand help")
162169

@@ -332,7 +339,9 @@ def main():
332339
video = cv2.VideoCapture(str(scene.renderer.file_writer.movie_file_path))
333340
success, image = video.read()
334341
if success:
335-
image_file_name = "git-sim-" + args.subcommand + "_" + t + ".jpg"
342+
image_file_name = (
343+
"git-sim-" + args.subcommand + "_" + t + "." + args.img_format
344+
)
336345
image_file_path = os.path.join(
337346
os.path.join(config.media_dir, "images"), image_file_name
338347
)

0 commit comments

Comments
 (0)