Closed bfmat closed 3 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.
I've made two improvements to the code for adding images and videos:
pathlib.Path
(previously a crash would occur if you provide apathlib.Path
to a video on disk)imageio
functions (in some cases I've had to use custom values formacro_block_size
; with this version you can input arbitrary suchimageio
arguments intoadd_image
andadd_video
).