danijar / handout

Turn Python scripts into handouts with Markdown and figures
Apache License 2.0
2.02k stars 106 forks source link

Accept pathlib.Path filenames and forward **imageio_kwargs #45

Closed bfmat closed 3 years ago

bfmat commented 4 years ago

I've made two improvements to the code for adding images and videos:

danijar commented 4 years ago

Thanks for the PR, Brendon. I don't want to support imageio kwargs through the public API to keep the option option to save images with a different backend in the future. Users can already do this to include images with custom formats and settings:

filename = str(uuid.uuid4()) + '.png'
imageio.imsave(array, str(outdir / filename))
doc.add_image(filename)

Does this seem like a reasonable solution? If you have another suggestion, please let me know.